openreader/tests/delete.spec.ts
Richard R 5f28be5d58 refactor(env): remove legacy no-auth mode and enforce required auth env vars
Eliminate all code paths, configuration, and documentation related to running
without authentication. Require AUTH_SECRET and BASE_URL at startup, updating
middleware, server logic, and runtime checks to assume auth is always enabled.
Simplify onboarding, settings, and test helpers to reflect mandatory auth.
Update environment examples, Docker and deployment docs, and CI/test configs.
Remove no-auth-specific UI flows, test cases, and feature toggles.
2026-05-31 12:09:37 -06:00

26 lines
890 B
TypeScript

import { test, expect } from '@playwright/test';
import { setupTest, uploadFile, expectDocumentListed, expectNoDocumentLink, deleteDocumentByName } from './helpers';
test.describe('Document deletion flow', () => {
test.beforeEach(async ({ page }, testInfo) => {
await setupTest(page, testInfo);
});
test('deletes a document and updates list', async ({ page }) => {
// Upload two documents
await uploadFile(page, 'sample.pdf');
await uploadFile(page, 'sample.txt');
// Verify both appear
await expectDocumentListed(page, 'sample.pdf');
await expectDocumentListed(page, 'sample.txt');
// Delete the TXT document via row action
await deleteDocumentByName(page, 'sample.txt');
// Assert the TXT document is removed, PDF remains
await expectNoDocumentLink(page, 'sample.txt');
await expectDocumentListed(page, 'sample.pdf');
});
});