xuất excel

This commit is contained in:
2026-10-14 09:10:37 +07:00
parent dff0d32912
commit 533923076c
19 changed files with 1655 additions and 236 deletions

View File

@@ -121,6 +121,19 @@ test('forged legacy identity headers cannot bypass protected APIs', async () =>
});
});
test('saved export files, preview and batch exports require an authenticated session', async () => {
await withTestServer(async baseUrl => {
for (const [route, method] of [
['/api/asset-export-documents/f13b142b-913b-44b8-b15c-d719bd45d197', 'GET'],
['/api/asset-export-documents/f13b142b-913b-44b8-b15c-d719bd45d197/download', 'GET'],
['/api/assets/export', 'POST']
]) {
const response = await fetch(baseUrl + route, { method, headers: { 'x-user-role': 'admin' } });
assert.equal(response.status, 401);
}
});
});
test('security headers and no-store API caching are enabled', async () => {
await withTestServer(async baseUrl => {
const response = await fetch(`${baseUrl}/api/health`);