File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 6
6
</div >
7
7
8
8
<div id =' results' >
9
- <div class =' nav' >
9
+ <div class =' nav' data-test-categories-nav >
10
10
<span class =' amt small' >
11
11
Displaying
12
12
<span class =' cur' >{{ currentPageStart }} -{{ currentPageEnd }} </span >
13
13
of <span class =' total' >{{ totalItems }} </span > total results
14
14
</span >
15
15
</div >
16
16
17
- <div class =' sort' >
17
+ <div class =' sort' data-test-categories-sort >
18
18
<span class =' small' >Sort by</span >
19
19
{{ #rl-dropdown-container class =" dropdown-container" }}
20
- {{ #rl-dropdown-toggle tagName =" a" class =" dropdown" }}
20
+ {{ #rl-dropdown-toggle tagName =" a" class =" dropdown" data-test-current-order = true }}
21
21
{{ svg-jar " sort" }}
22
22
{{ currentSortBy }}
23
23
<span class =' arrow' ></span >
41
41
42
42
<div class =' white-rows' >
43
43
{{ #each model as |category |}}
44
- <div class =' row' >
44
+ <div class =' row' data-test-category = {{ category.slug }} >
45
45
<div class =' desc' >
46
46
<div class =' info' >
47
47
{{ link-to category.category " category" category.slug }}
48
- <span class =' small' >
48
+ <span class =' small' data-test-crate-count >
49
49
{{ pluralize (format-num category.crates_cnt ) " crate" }}
50
50
</span >
51
51
</div >
Original file line number Diff line number Diff line change 36
36
37
37
<h2 >Crates</h2 >
38
38
<div id =' results' >
39
- <div class =' nav' >
39
+ <div class =' nav' data-test-category-nav >
40
40
<span class =' amt small' >
41
41
Displaying
42
42
<span class =' cur' >{{ currentPageStart }} -{{ currentPageEnd }} </span >
43
43
of <span class =' total' >{{ totalItems }} </span > total results
44
44
</span >
45
45
</div >
46
46
47
- <div class =' sort' >
47
+ <div class =' sort' data-test-category-sort >
48
48
<span class =' small' >Sort by</span >
49
49
{{ #rl-dropdown-container class =" dropdown-container" }}
50
- {{ #rl-dropdown-toggle tagName =" a" class =" dropdown" }}
50
+ {{ #rl-dropdown-toggle tagName =" a" class =" dropdown" data-test-current-order = true }}
51
51
{{ svg-jar " sort" }}
52
52
{{ currentSortBy }}
53
53
<span class =' arrow' ></span >
Original file line number Diff line number Diff line change @@ -10,15 +10,15 @@ test('listing categories', async function(assert) {
10
10
11
11
await visit ( '/categories' ) ;
12
12
13
- assert . dom ( '.desc .info span' , find ( '.row' ) . get ( 0 ) ) . hasText ( '0 crates' ) ;
14
- assert . dom ( '.desc .info span' , find ( '.row' ) . get ( 1 ) ) . hasText ( '1 crate' ) ;
15
- assert . dom ( '.desc .info span' , find ( '.row' ) . get ( 2 ) ) . hasText ( '3,910 crates' ) ;
13
+ assert . dom ( '[data-test-category="api-bindings"] [data-test-crate-count]' ) . hasText ( '0 crates' ) ;
14
+ assert . dom ( '[data-test-category="algorithms"] [data-test-crate-count]' ) . hasText ( '1 crate' ) ;
15
+ assert . dom ( '[data-test-category="asynchronous"] [data-test-crate-count]' ) . hasText ( '3,910 crates' ) ;
16
16
} ) ;
17
17
18
18
test ( 'category/:category_id index default sort is recent-downloads' , async function ( assert ) {
19
19
server . create ( 'category' , { category : 'Algorithms' , crates_cnt : 1 } ) ;
20
20
21
21
await visit ( '/categories/algorithms' ) ;
22
22
23
- assert . dom ( 'div. sort div.dropdown-container a.dropdown ' ) . hasText ( 'Recent Downloads' ) ;
23
+ assert . dom ( '[data-test-category- sort] [data-test-current-order] ' ) . hasText ( 'Recent Downloads' ) ;
24
24
} ) ;
You can’t perform that action at this time.
0 commit comments