Skip to content

Commit

Permalink
384th Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Chen committed Oct 9, 2024
1 parent 487b4e7 commit 98d1b9b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
**/node_modules
**/dist
**/coverage
**/test-results
*.log
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
**/node_modules
**/dist
**/coverage
**/test-results
*.log
17 changes: 17 additions & 0 deletions e2e/src/todos.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
import { expect, test } from '@playwright/test';

test.describe.configure({ mode: 'serial' });

test('POST /api/todos', async ({ request }) => {
const response = await request.post('/api/todos', { data: {} });
const data = await response.json();
expect(data.total).toEqual(3);
});

test('POST /api/todos/new', async ({ request }) => {
const response = await request.post('/api/todos/new', {
data: { title: 'foo' },
});
const data = await response.json();
expect(data.message).toEqual('OK');
});

test('POST /api/todos { "title": "foo" }', async ({ request }) => {
const response = await request.post('/api/todos', { data: { title: 'foo' } });
const data = await response.json();
expect(data.total).toEqual(1);
expect(data.result[0]).toEqual(expect.objectContaining({ title: 'foo', completed: false }));
});

0 comments on commit 98d1b9b

Please sign in to comment.