@@ -7,7 +7,7 @@ test('visiting a crate page from the front page', async function(assert) {
7
7
server . create ( 'crate' , 'withVersion' , { id : 'nanomsg' } ) ;
8
8
9
9
await visit ( '/' ) ;
10
- await click ( '# just-updated ul > li:first a ' ) ;
10
+ await click ( '[data-test- just-updated] [data-test-crate-link="0"] ' ) ;
11
11
12
12
assert . equal ( currentURL ( ) , '/crates/nanomsg' ) ;
13
13
assert . equal ( document . title , 'nanomsg - Cargo: packages for Rust' ) ;
@@ -24,8 +24,8 @@ test('visiting /crates/nanomsg', async function(assert) {
24
24
assert . equal ( currentRouteName ( ) , 'crate.index' ) ;
25
25
assert . equal ( document . title , 'nanomsg - Cargo: packages for Rust' ) ;
26
26
27
- assert . dom ( '#crates- heading .info h1 ' ) . hasText ( 'nanomsg' ) ;
28
- assert . dom ( '#crates- heading .info h2 ' ) . hasText ( '0.6.1' ) ;
27
+ assert . dom ( '[data-test- heading] [data-test-crate-name] ' ) . hasText ( 'nanomsg' ) ;
28
+ assert . dom ( '[data-test- heading] [data-test-crate-version] ' ) . hasText ( '0.6.1' ) ;
29
29
} ) ;
30
30
31
31
test ( 'visiting /crates/nanomsg/' , async function ( assert ) {
@@ -39,8 +39,8 @@ test('visiting /crates/nanomsg/', async function(assert) {
39
39
assert . equal ( currentRouteName ( ) , 'crate.index' ) ;
40
40
assert . equal ( document . title , 'nanomsg - Cargo: packages for Rust' ) ;
41
41
42
- assert . dom ( '#crates- heading .info h1 ' ) . hasText ( 'nanomsg' ) ;
43
- assert . dom ( '#crates- heading .info h2 ' ) . hasText ( '0.6.1' ) ;
42
+ assert . dom ( '[data-test- heading] [data-test-crate-name] ' ) . hasText ( 'nanomsg' ) ;
43
+ assert . dom ( '[data-test- heading] [data-test-crate-version] ' ) . hasText ( '0.6.1' ) ;
44
44
} ) ;
45
45
46
46
test ( 'visiting /crates/nanomsg/0.6.0' , async function ( assert ) {
@@ -54,15 +54,15 @@ test('visiting /crates/nanomsg/0.6.0', async function(assert) {
54
54
assert . equal ( currentRouteName ( ) , 'crate.version' ) ;
55
55
assert . equal ( document . title , 'nanomsg - Cargo: packages for Rust' ) ;
56
56
57
- assert . dom ( '#crates- heading .info h1 ' ) . hasText ( 'nanomsg' ) ;
58
- assert . dom ( '#crates- heading .info h2 ' ) . hasText ( '0.6.0' ) ;
57
+ assert . dom ( '[data-test- heading] [data-test-crate-name] ' ) . hasText ( 'nanomsg' ) ;
58
+ assert . dom ( '[data-test- heading] [data-test-crate-version] ' ) . hasText ( '0.6.0' ) ;
59
59
} ) ;
60
60
61
61
test ( 'navigating to the all versions page' , async function ( assert ) {
62
62
server . loadFixtures ( ) ;
63
63
64
64
await visit ( '/crates/nanomsg' ) ;
65
- await click ( '#crate- versions span.small a ' ) ;
65
+ await click ( '[data-test-all- versions-link] ' ) ;
66
66
67
67
assert . dom ( '.info' ) . hasText ( / A l l 1 3 \s + v e r s i o n s o f n a n o m s g s i n c e \s + D e c e m b e r \d + , 2 0 1 4 / ) ;
68
68
} ) ;
@@ -71,7 +71,7 @@ test('navigating to the reverse dependencies page', async function(assert) {
71
71
server . loadFixtures ( ) ;
72
72
73
73
await visit ( '/crates/nanomsg' ) ;
74
- await click ( 'a:contains("Dependent crates") ' ) ;
74
+ await click ( '[data-test-reverse-deps-link] ' ) ;
75
75
76
76
assert . equal ( currentURL ( ) , '/crates/nanomsg/reverse_dependencies' ) ;
77
77
assert . dom ( 'a[href="/crates/unicorn-rpc"]' ) . hasText ( 'unicorn-rpc' ) ;
@@ -81,46 +81,48 @@ test('navigating to a user page', async function(assert) {
81
81
server . loadFixtures ( ) ;
82
82
83
83
await visit ( '/crates/nanomsg' ) ;
84
- await click ( '. owners li:last a ' ) ;
84
+ await click ( '[data-test- owners] [data-test-user-link="blabaere"] ' ) ;
85
85
86
86
assert . equal ( currentURL ( ) , '/users/blabaere' ) ;
87
- assert . dom ( '#crates- heading h1 ' ) . hasText ( 'blabaere' ) ;
87
+ assert . dom ( '[data-test- heading] [data-test-username] ' ) . hasText ( 'blabaere' ) ;
88
88
} ) ;
89
89
90
90
test ( 'navigating to a team page' , async function ( assert ) {
91
91
server . loadFixtures ( ) ;
92
92
93
93
await visit ( '/crates/nanomsg' ) ;
94
- await click ( '. owners li:first a ' ) ;
94
+ await click ( '[data-test- owners] [data-test-team-link="github:org:thehydroimpulse"] ' ) ;
95
95
96
96
assert . equal ( currentURL ( ) , '/teams/github:org:thehydroimpulse' ) ;
97
- assert . dom ( '.team-info h2 ' ) . hasText ( 'thehydroimpulseteam' ) ;
97
+ assert . dom ( '[data-test-heading] [data-test-team-name] ' ) . hasText ( 'thehydroimpulseteam' ) ;
98
98
} ) ;
99
99
100
100
test ( 'crates having user-owners' , async function ( assert ) {
101
101
server . loadFixtures ( ) ;
102
102
103
103
await visit ( '/crates/nanomsg' ) ;
104
104
105
- assert . dom ( 'ul.owners li a[href="/teams/github:org:thehydroimpulse"] img[src="https://avatars.githubusercontent.com/u/565790?v=3&s=64"]' ) . exists ( ) ;
106
- assert . dom ( 'ul.owners li' ) . exists ( { count : 4 } ) ;
105
+ assert . dom ( '[data-test-owners] [data-test-team-link="github:org:thehydroimpulse"] img' )
106
+ . hasAttribute ( 'src' , 'https://avatars.githubusercontent.com/u/565790?v=3&s=64' ) ;
107
+
108
+ assert . dom ( '[data-test-owners] li' ) . exists ( { count : 4 } ) ;
107
109
} ) ;
108
110
109
111
test ( 'crates having team-owners' , async function ( assert ) {
110
112
server . loadFixtures ( ) ;
111
113
112
114
await visit ( '/crates/nanomsg' ) ;
113
115
114
- assert . dom ( 'ul. owners li a[href="/teams/ github:org:thehydroimpulse"]' ) . exists ( ) ;
115
- assert . dom ( 'ul. owners li' ) . exists ( { count : 4 } ) ;
116
+ assert . dom ( '[data-test- owners] [data-test-team-link=" github:org:thehydroimpulse"]' ) . exists ( ) ;
117
+ assert . dom ( '[data-test- owners] li' ) . exists ( { count : 4 } ) ;
116
118
} ) ;
117
119
118
120
test ( 'crates license is supplied by version' , async function ( assert ) {
119
121
server . loadFixtures ( ) ;
120
122
121
123
await visit ( '/crates/nanomsg' ) ;
122
- assert . dom ( '. license' ) . hasText ( 'Apache-2.0' ) ;
124
+ assert . dom ( '[data-test- license] ' ) . hasText ( 'Apache-2.0' ) ;
123
125
124
126
await click ( '#crate-versions a:contains("0.5.0")' ) ;
125
- assert . dom ( '. license' ) . hasText ( 'MIT/Apache-2.0' ) ;
127
+ assert . dom ( '[data-test- license] ' ) . hasText ( 'MIT/Apache-2.0' ) ;
126
128
} ) ;
0 commit comments