mirror of
https://github.com/documenso/documenso.git
synced 2026-07-27 18:35:05 +10:00
test(e2e): update document specs for faceted toolbar filters
This commit is contained in:
@@ -67,7 +67,9 @@ test('[DOCUMENTS]: cancelling a pending document keeps it in the owner dashboard
|
|||||||
await checkDocumentTabCount(page, 'All', 1);
|
await checkDocumentTabCount(page, 'All', 1);
|
||||||
|
|
||||||
// The cancelled document is still listed.
|
// The cancelled document is still listed.
|
||||||
await page.getByRole('tab', { name: 'Cancelled' }).click();
|
await page.getByRole('button', { name: /Status/ }).click();
|
||||||
|
await page.getByRole('option', { name: 'Cancelled' }).click();
|
||||||
|
await page.keyboard.press('Escape');
|
||||||
await expect(page.getByRole('link', { name: 'Document 1 - Pending' })).toBeVisible();
|
await expect(page.getByRole('link', { name: 'Document 1 - Pending' })).toBeVisible();
|
||||||
|
|
||||||
// The envelope status is persisted as CANCELLED.
|
// The envelope status is persisted as CANCELLED.
|
||||||
@@ -131,7 +133,9 @@ test('[DOCUMENTS]: a cancelled document can be deleted, hiding it from the owner
|
|||||||
await expectToastTextToBeVisible(page, 'Document cancelled');
|
await expectToastTextToBeVisible(page, 'Document cancelled');
|
||||||
|
|
||||||
// Delete the now-cancelled document. Being terminal, it should soft delete (hide).
|
// Delete the now-cancelled document. Being terminal, it should soft delete (hide).
|
||||||
await page.getByRole('tab', { name: 'Cancelled' }).click();
|
await page.getByRole('button', { name: /Status/ }).click();
|
||||||
|
await page.getByRole('option', { name: 'Cancelled' }).click();
|
||||||
|
await page.keyboard.press('Escape');
|
||||||
|
|
||||||
const documentActionBtn = page
|
const documentActionBtn = page
|
||||||
.locator('tr', { hasText: 'Document 1 - Pending' })
|
.locator('tr', { hasText: 'Document 1 - Pending' })
|
||||||
|
|||||||
@@ -807,8 +807,8 @@ test.describe('Find Documents UI - Data Isolation & No Leaking', () => {
|
|||||||
await checkDocumentTabCount(page, 'Draft', 1);
|
await checkDocumentTabCount(page, 'Draft', 1);
|
||||||
await checkDocumentTabCount(page, 'Completed', 1);
|
await checkDocumentTabCount(page, 'Completed', 1);
|
||||||
|
|
||||||
// Verify no B docs leaked
|
// Verify no B docs leaked (default view shows all statuses)
|
||||||
await page.getByRole('tab', { name: 'All' }).click();
|
await page.goto(`/t/${teamA.url}/documents`);
|
||||||
await expect(page.getByRole('link', { name: 'A Own Draft' })).toBeVisible();
|
await expect(page.getByRole('link', { name: 'A Own Draft' })).toBeVisible();
|
||||||
await expect(page.getByRole('link', { name: 'B Draft Private', exact: true })).not.toBeVisible();
|
await expect(page.getByRole('link', { name: 'B Draft Private', exact: true })).not.toBeVisible();
|
||||||
await expect(page.getByRole('link', { name: 'B Pending Private', exact: true })).not.toBeVisible();
|
await expect(page.getByRole('link', { name: 'B Pending Private', exact: true })).not.toBeVisible();
|
||||||
@@ -1156,7 +1156,7 @@ test.describe('Find Documents UI - Sender Filter', () => {
|
|||||||
await checkDocumentTabCount(page, 'All', 3);
|
await checkDocumentTabCount(page, 'All', 3);
|
||||||
|
|
||||||
// Filter by member1
|
// Filter by member1
|
||||||
await page.locator('button').filter({ hasText: 'Sender: All' }).click();
|
await page.getByRole('button', { name: /Sender/ }).click();
|
||||||
await page.getByRole('option', { name: member1.name ?? '' }).click();
|
await page.getByRole('option', { name: member1.name ?? '' }).click();
|
||||||
await page.waitForURL(/senderIds/);
|
await page.waitForURL(/senderIds/);
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ export const checkDocumentTabCount = async (page: Page, tabName: string, count:
|
|||||||
Pending: 'PENDING',
|
Pending: 'PENDING',
|
||||||
Completed: 'COMPLETED',
|
Completed: 'COMPLETED',
|
||||||
Draft: 'DRAFT',
|
Draft: 'DRAFT',
|
||||||
|
Cancelled: 'CANCELLED',
|
||||||
|
Rejected: 'REJECTED',
|
||||||
All: undefined,
|
All: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user