integration: return HTTP 404 for unmatched URLs and close remaining browser-gate gaps
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
19
src/app/app.routes.server.spec.ts
Normal file
19
src/app/app.routes.server.spec.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { RenderMode } from '@angular/ssr';
|
||||
import { serverRoutes } from './app.routes.server';
|
||||
|
||||
describe('server routes', () => {
|
||||
it('returns HTTP 404 from the catch-all and leaves prerendered routes without a status', () => {
|
||||
const catchAll = serverRoutes.find((route) => route.path === '**');
|
||||
|
||||
expect(catchAll?.renderMode).toBe(RenderMode.Server);
|
||||
expect(catchAll && 'status' in catchAll ? catchAll.status : undefined).toBe(404);
|
||||
|
||||
const prerendered = serverRoutes.filter((route) => route.path !== '**');
|
||||
expect(prerendered.length).toBeGreaterThan(0);
|
||||
|
||||
for (const route of prerendered) {
|
||||
expect(route.renderMode, route.path).toBe(RenderMode.Prerender);
|
||||
expect('status' in route, `${route.path} must not set status`).toBe(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user