🐛(nginx) fix 404 when accessing a doc
We improve the nginx way to access to a specific doc. We stop to wait for a initial attempt that give a 404. If we see a UUID in the url we will redirect to the doc/[id] page. Next will then manage the 404.
This commit is contained in:
@@ -54,18 +54,11 @@ test.describe.serial('Language', () => {
|
||||
}) => {
|
||||
// Helper function to intercept and assert 404 response
|
||||
const check404Response = async (expectedDetail: string) => {
|
||||
const expectedBackendResponse = page.waitForResponse(
|
||||
(response) =>
|
||||
response.url().includes('/api') &&
|
||||
response.url().includes('non-existent-doc-uuid') &&
|
||||
response.status() === 404,
|
||||
const interceptedBackendResponse = await page.request.get(
|
||||
'http://localhost:8071/api/v1.0/documents/non-existent-doc-uuid/',
|
||||
);
|
||||
|
||||
// Trigger the specific 404 XHR response by navigating to a non-existent document
|
||||
await page.goto('/docs/non-existent-doc-uuid');
|
||||
|
||||
// Assert that the intercepted error message is in the expected language
|
||||
const interceptedBackendResponse = await expectedBackendResponse;
|
||||
expect(await interceptedBackendResponse.json()).toStrictEqual({
|
||||
detail: expectedDetail,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user