mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
18 lines
555 B
TypeScript
18 lines
555 B
TypeScript
import type { Page } from '@playwright/test';
|
|
import { expect } from '@playwright/test';
|
|
|
|
export const checkDocumentTabCount = async (page: Page, tabName: string, count: number) => {
|
|
await page.getByRole('tab', { name: tabName }).click();
|
|
|
|
if (tabName !== 'All') {
|
|
await expect(page.getByRole('tab', { name: tabName })).toContainText(count.toString());
|
|
}
|
|
|
|
if (count === 0) {
|
|
await expect(page.getByTestId('empty-document-state')).toBeVisible();
|
|
return;
|
|
}
|
|
|
|
await expect(page.getByRole('main')).toContainText(`Showing ${count}`);
|
|
};
|