Skip to content

Commit

Permalink
remove some assert.expect, instead use await
Browse files Browse the repository at this point in the history
  • Loading branch information
jlami committed Jan 14, 2020
1 parent ce9adeb commit 493919d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
9 changes: 4 additions & 5 deletions tests/acceptance/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ module('Acceptance - Todo Index', function(hooks) {
server.shutdown();
});

test('Should showo todos', function(assert) {
assert.expect(1);
visit("/todos/remote").then(function() {
assert.equal(findAll(".todo").length, 10);
});
test('Should showo todos', async function(assert) {
await visit("/todos/remote");

assert.equal(findAll(".todo").length, 10)
});
});
5 changes: 2 additions & 3 deletions tests/acceptance/infinite-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ let todosTestLocal = function(name, f) {
test(name, async function(assert) {
await visit("/todos/infinite");

f(assert);
await f(assert);
});
};

let todosTestRemote = function(name, f) {
test(name, async function(assert) {
await visit("/todos/infinite-remote");

f(assert);
await f(assert);
});
};

Expand All @@ -28,7 +28,6 @@ let runTests = function(todosTest) {
});

todosTest("next page", async function(assert) {
assert.expect(2);
hasTodos(assert,10);

await click(".infinite .next a");
Expand Down
14 changes: 0 additions & 14 deletions tests/acceptance/pagination-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,13 @@ let createTests = function(todosTest) {
});

todosTest("clicking page 2", async function(assert) {
assert.expect(5);

await clickPage(2);
hasTodos(assert,10);
hasActivePage(assert,2);
});


todosTest("clicking page 4", async function(assert) {
assert.expect(7);

await clickPage(4);
hasTodos(assert,3);
hasActivePage(assert,4);
Expand All @@ -82,8 +78,6 @@ let createTests = function(todosTest) {
// },2);

todosTest("next button - proper buttons visible", function(assert) {
assert.expect(6);

hasActivePage(assert,1);
hasButtons(assert,{
prev: false,
Expand All @@ -92,8 +86,6 @@ let createTests = function(todosTest) {
});

todosTest("click next", async function(assert) {
assert.expect(7);

await clickPage("next");
hasButtons(assert,{
prev: true,
Expand All @@ -104,8 +96,6 @@ let createTests = function(todosTest) {
});

todosTest("click prev", async function(assert) {
assert.expect(7);

await clickPage(2);
await clickPage("prev");
hasButtons(assert,{
Expand All @@ -117,8 +107,6 @@ let createTests = function(todosTest) {
});

todosTest("click next on last page and not increment", async function(assert) {
//assert.expect(5);

await clickPage(4);
await clickPage("next");
await clickPage("next");
Expand All @@ -130,8 +118,6 @@ let createTests = function(todosTest) {
});

todosTest("click prev on first page and not decrement", async function(assert) {
assert.expect(5);

await clickPage("prev");
await clickPage("prev");
hasTodos(assert,10);
Expand Down

0 comments on commit 493919d

Please sign in to comment.