mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-09-26 20:41:45 +00:00
chore: cleanup
This commit is contained in:
@@ -1,19 +1,15 @@
|
|||||||
import { expect, test } from '@playwright/test'
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
// The SPA fallback serves index.html for client side routes. The document is
|
test.describe("@web", () => {
|
||||||
// served successfully, so it must not be reported as 404.
|
for (const path of ["/", "/about", "/note/does-not-exist"]) {
|
||||||
// A missing note is signalled by the API on /api/notes/<id> instead.
|
|
||||||
// https://github.com/cupcakearmy/cryptgeon/issues/217
|
|
||||||
test.describe('@web', () => {
|
|
||||||
for (const path of ['/', '/about', '/note/does-not-exist']) {
|
|
||||||
test(`serves ${path} with status 200`, async ({ request }) => {
|
test(`serves ${path} with status 200`, async ({ request }) => {
|
||||||
const response = await request.get(path)
|
const response = await request.get(path);
|
||||||
expect(response.status()).toBe(200)
|
expect(response.status()).toBe(200);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
test('api still reports a missing note as 404', async ({ request }) => {
|
test("api still reports a missing note as 404", async ({ request }) => {
|
||||||
const response = await request.get('/api/notes/does-not-exist')
|
const response = await request.get("/api/notes/does-not-exist");
|
||||||
expect(response.status()).toBe(404)
|
expect(response.status()).toBe(404);
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user