File tree Expand file tree Collapse file tree 4 files changed +72
-7
lines changed Expand file tree Collapse file tree 4 files changed +72
-7
lines changed Original file line number Diff line number Diff line change @@ -70,9 +70,19 @@ export default Controller.extend({
7070 }
7171
7272 return PromiseArray . create ( {
73- promise : deps . then ( deps => {
74- return deps . filter ( dep => dep . get ( 'kind' ) !== 'dev' ) . uniqBy ( 'crate_id' ) ;
75- } ) ,
73+ promise : deps . then ( deps => deps . filterBy ( 'kind' , 'normal' ) . uniqBy ( 'crate_id' ) ) ,
74+ } ) ;
75+ } ) ,
76+
77+ currentBuildDependencies : computed ( 'currentVersion.dependencies' , function ( ) {
78+ let deps = this . get ( 'currentVersion.dependencies' ) ;
79+
80+ if ( deps === null ) {
81+ return [ ] ;
82+ }
83+
84+ return PromiseArray . create ( {
85+ promise : deps . then ( deps => deps . filterBy ( 'kind' , 'build' ) . uniqBy ( 'crate_id' ) ) ,
7686 } ) ;
7787 } ) ,
7888
@@ -82,9 +92,7 @@ export default Controller.extend({
8292 return [ ] ;
8393 }
8494 return PromiseArray . create ( {
85- promise : deps . then ( deps => {
86- return deps . filterBy ( 'kind' , 'dev' ) ;
87- } ) ,
95+ promise : deps . then ( deps => deps . filterBy ( 'kind' , 'dev' ) . uniqBy ( 'crate_id' ) ) ,
8896 } ) ;
8997 } ) ,
9098
Original file line number Diff line number Diff line change 217217 </ul >
218218 </div >
219219
220+ {{ #if currentBuildDependencies }}
221+ <div class =' section' id =' crate-build-dependencies' >
222+ <h3 >Build-Dependencies</h3 >
223+ <ul >
224+ {{ #each currentBuildDependencies as |dep |}}
225+ {{ link-to-dep tagName =" li" dep =dep }}
226+ {{ /each }}
227+ </ul >
228+ </div >
229+ {{ /if }}
230+
220231 {{ #if currentDevDependencies }}
221232 <div class =' section' id =' crate-dev-dependencies' >
222233 <h3 >Dev-Dependencies</h3 >
Original file line number Diff line number Diff line change @@ -26,11 +26,33 @@ export default [
2626 crate_id : 'nanomsg' ,
2727 default_features : true ,
2828 features : '' ,
29- id : 90880 ,
29+ id : 146233 ,
3030 kind : 'normal' ,
3131 optional : false ,
3232 req : '^0.5.0' ,
3333 target : null ,
3434 version_id : 28674 ,
3535 } ,
36+ {
37+ crate_id : 'mock-build-deps' ,
38+ default_features : true ,
39+ features : '' ,
40+ id : 146234 ,
41+ kind : 'build' ,
42+ optional : false ,
43+ req : '^0.6.1' ,
44+ target : null ,
45+ version_id : 40905 ,
46+ } ,
47+ {
48+ crate_id : 'mock-dev-deps' ,
49+ default_features : true ,
50+ features : '' ,
51+ id : 146235 ,
52+ kind : 'dev' ,
53+ optional : true ,
54+ req : '^0.6.1' ,
55+ target : null ,
56+ version_id : 40905 ,
57+ } ,
3658] ;
Original file line number Diff line number Diff line change @@ -154,6 +154,30 @@ module('Acceptance | crate page', function(hooks) {
154154 assert . dom ( '[data-test-heading] [data-test-team-name]' ) . hasText ( 'thehydroimpulseteam' ) ;
155155 } ) ;
156156
157+ test ( 'crates having normal dependencies' , async function ( assert ) {
158+ this . server . loadFixtures ( ) ;
159+
160+ await visit ( 'crates/nanomsg' ) ;
161+
162+ assert . dom ( '#crate-dependencies li' ) . exists ( { count : 2 } ) ;
163+ } ) ;
164+
165+ test ( 'crates having build dependencies' , async function ( assert ) {
166+ this . server . loadFixtures ( ) ;
167+
168+ await visit ( 'crates/nanomsg' ) ;
169+
170+ assert . dom ( '#crate-build-dependencies li' ) . exists ( { count : 1 } ) ;
171+ } ) ;
172+
173+ test ( 'crates having dev dependencies' , async function ( assert ) {
174+ this . server . loadFixtures ( ) ;
175+
176+ await visit ( 'crates/nanomsg' ) ;
177+
178+ assert . dom ( '#crate-dev-dependencies li' ) . exists ( { count : 1 } ) ;
179+ } ) ;
180+
157181 test ( 'crates having user-owners' , async function ( assert ) {
158182 this . server . loadFixtures ( ) ;
159183
You can’t perform that action at this time.
0 commit comments