Skip to content

Commit d451f78

Browse files
authored
Merge pull request #830 from Turbo87/async-await
tests/acceptance/crate: Use async/await
2 parents 85b0183 + d2286a5 commit d451f78

File tree

1 file changed

+19
-27
lines changed

1 file changed

+19
-27
lines changed

tests/acceptance/crate-test.js

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -64,40 +64,32 @@ test('navigating to the reverse dependencies page', async function(assert) {
6464
hasText(assert, $revDep, 'unicorn-rpc');
6565
});
6666

67-
test('navigating to a user page', function(assert) {
68-
visit('/crates/nanomsg');
69-
click('.owners li:last a');
70-
71-
andThen(function() {
72-
assert.equal(currentURL(), '/users/blabaere');
73-
hasText(assert, '#crates-heading h1', 'thehydroimpulse');
74-
});
67+
test('navigating to a user page', async function(assert) {
68+
await visit('/crates/nanomsg');
69+
await click('.owners li:last a');
70+
71+
assert.equal(currentURL(), '/users/blabaere');
72+
hasText(assert, '#crates-heading h1', 'thehydroimpulse');
7573
});
7674

77-
test('navigating to a team page', function(assert) {
78-
visit('/crates/nanomsg');
79-
click('.owners li:first a ');
75+
test('navigating to a team page', async function(assert) {
76+
await visit('/crates/nanomsg');
77+
await click('.owners li:first a ');
8078

81-
andThen(function() {
82-
assert.equal(currentURL(), '/teams/github:org:thehydroimpulse');
83-
hasText(assert, '.team-info h2', 'thehydroimpulseteam');
84-
});
79+
assert.equal(currentURL(), '/teams/github:org:thehydroimpulse');
80+
hasText(assert, '.team-info h2', 'thehydroimpulseteam');
8581
});
8682

87-
test('crates having user-owners', function(assert) {
88-
visit('/crates/nanomsg');
83+
test('crates having user-owners', async function(assert) {
84+
await visit('/crates/nanomsg');
8985

90-
andThen(function() {
91-
findWithAssert('ul.owners li:first a[href="/teams/github:org:thehydroimpulse"] img[src="https://avatars.githubusercontent.com/u/565790?v=3&s=64"]');
92-
assert.equal(find('ul.owners li').length, 4);
93-
});
86+
findWithAssert('ul.owners li:first a[href="/teams/github:org:thehydroimpulse"] img[src="https://avatars.githubusercontent.com/u/565790?v=3&s=64"]');
87+
assert.equal(find('ul.owners li').length, 4);
9488
});
9589

96-
test('crates having team-owners', function(assert) {
97-
visit('/crates/nanomsg');
90+
test('crates having team-owners', async function(assert) {
91+
await visit('/crates/nanomsg');
9892

99-
andThen(function() {
100-
findWithAssert('ul.owners li:first a[href="/teams/github:org:thehydroimpulse"]');
101-
assert.equal(find('ul.owners li').length, 4);
102-
});
93+
findWithAssert('ul.owners li:first a[href="/teams/github:org:thehydroimpulse"]');
94+
assert.equal(find('ul.owners li').length, 4);
10395
});

0 commit comments

Comments
 (0)