diff --git a/tests/e2e/settings.spec.ts b/tests/e2e/settings.spec.ts index addeeec..bc3117d 100644 --- a/tests/e2e/settings.spec.ts +++ b/tests/e2e/settings.spec.ts @@ -26,6 +26,13 @@ test.describe('Settings — Preferences', () => { // Then the note editor opens in markdown mode (textarea visible) await expect(page.getByTestId('note-content-input')).toBeVisible(); + + // Cleanup: reset to richtext so parallel tests aren't affected + await page.getByTestId('close-editor-btn').click(); + await page.goto('/settings/preferences'); + const resetResponse = page.waitForResponse((res) => res.url().includes('/api/preferences') && res.request().method() === 'PUT'); + await page.getByTestId('pref-mode-richtext').click(); + await resetResponse; }); test('Scenario: Footer toggle hides and shows footer', async ({ @@ -65,6 +72,11 @@ test.describe('Settings — Preferences', () => { // Then the Markdown button is still selected (has primary styling) const mdBtn = page.getByTestId('pref-mode-markdown'); await expect(mdBtn).toHaveClass(/font-medium/); + + // Cleanup: reset to richtext so parallel tests aren't affected + const resetResponse = page.waitForResponse((res) => res.url().includes('/api/preferences') && res.request().method() === 'PUT'); + await page.getByTestId('pref-mode-richtext').click(); + await resetResponse; }); }); diff --git a/tests/e2e/sharing.spec.ts b/tests/e2e/sharing.spec.ts index ce46274..2b6acb3 100644 --- a/tests/e2e/sharing.spec.ts +++ b/tests/e2e/sharing.spec.ts @@ -35,13 +35,12 @@ test.describe('Note Sharing', () => { authenticatedPage: page, collabPage }) => { - // When the owner creates a note titled "Share Test" - await page.getByTestId('new-note-btn').click(); - await page.getByTestId('note-title-input').fill('Share Test'); - const editor = page.getByTestId('tiptap-editor').locator('.tiptap'); - await editor.click(); - await editor.pressSequentially('Shared content'); - await page.getByTestId('close-editor-btn').click(); + // Given a note titled "Share Test" exists + await page.request.post('/api/notes', { + data: { title: 'Share Test', content: 'Shared content' } + }); + await page.reload(); + await page.waitForLoadState('networkidle'); await expect(noteCard(page, 'Share Test')).toBeVisible(); // And the owner opens the share dialog and adds the collaborator