Add API models, mock backend, more tests

This commit is contained in:
Jan Tuomi
2018-06-20 14:51:12 +03:00
parent 4ba5b368a6
commit 9e2403ba8a
15 changed files with 686 additions and 1923 deletions
+11 -1
View File
@@ -34,4 +34,14 @@ test("Increment button functions correctly", async t => {
await t.expect(button.textContent).contains("0");
await t.click(button);
await t.expect(button.textContent).contains("1");
});
});
fixture`Posts from API`.page("http://localhost:3000");
test("At least one post exists", async t => {
/**
* Test if the API responds with at least one post and it is rendered to the page
*/
const post = Selector(".post");
await t.expect(post.exists).ok();
});