Files
outline/server/routes/api/documents/__snapshots__/documents.test.ts.snap
T
Tom Moor 091346dfe8 chore: Migrate to vitest (#12272)
* wip

* Remove obsolete snapshots

* simplify

* chore(test): Convert mocks to TypeScript and tighten fetch mock types

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Remove unneccessary patches

* Migrate to msw instead of custom fetch mock

* Address PR review comments

- Split chained vi.useFakeTimers().setSystemTime() into separate calls.
- Switch test setup to dynamic imports so EventEmitter.defaultMaxListeners
  assignment runs before module init (static imports were hoisted above it).
- Drop redundant NODE_ENV guard in monkeyPatchSequelizeErrorsForJest; its
  sole caller already gates on env.isTest.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-06 21:10:51 -04:00

110 lines
2.3 KiB
Plaintext

// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`#documents.create > should error with invalid parentDocument 1`] = `
{
"error": "authorization_error",
"message": "Authorization error",
"ok": false,
"status": 403,
}
`;
exports[`#documents.delete > should require authentication 1`] = `
{
"error": "authentication_required",
"message": "Authentication required",
"ok": false,
"status": 401,
}
`;
exports[`#documents.documents > should require authentication 1`] = `
{
"error": "authentication_required",
"message": "Authentication required",
"ok": false,
"status": 401,
}
`;
exports[`#documents.documents > should return 403 if user does not have access to the document 1`] = `
{
"error": "authorization_error",
"message": "Authorization error",
"ok": false,
"status": 403,
}
`;
exports[`#documents.empty_trash > should not allow non-admin users 1`] = `
{
"error": "authorization_error",
"message": "Admin role required",
"ok": false,
"status": 403,
}
`;
exports[`#documents.empty_trash > should require authentication 1`] = `
{
"error": "authentication_required",
"message": "Authentication required",
"ok": false,
"status": 401,
}
`;
exports[`#documents.list > should require authentication 1`] = `
{
"error": "authentication_required",
"message": "Authentication required",
"ok": false,
"status": 401,
}
`;
exports[`#documents.restore > should require authentication 1`] = `
{
"error": "authentication_required",
"message": "Authentication required",
"ok": false,
"status": 401,
}
`;
exports[`#documents.search > should require authentication 1`] = `
{
"error": "authentication_required",
"message": "Authentication error",
"ok": false,
"status": 401,
}
`;
exports[`#documents.update > should require authentication 1`] = `
{
"error": "authentication_required",
"message": "Authentication required",
"ok": false,
"status": 401,
}
`;
exports[`#documents.update > should require text while appending 1`] = `
{
"error": "validation_error",
"message": "text is required when using append, prepend, or editMode",
"ok": false,
"status": 400,
}
`;
exports[`#documents.viewed > should require authentication 1`] = `
{
"error": "authentication_required",
"message": "Authentication required",
"ok": false,
"status": 401,
}
`;