tests: add test for about AFFiNE

This commit is contained in:
tzhangchi
2022-12-23 17:32:23 +08:00
parent 5403a2218e
commit b7e46fc775
2 changed files with 20 additions and 1 deletions
@@ -20,7 +20,7 @@ export const WorkspaceSelector = () => {
trigger="click"
onVisibleChange={setIsShow}
>
<SelectorWrapper>
<SelectorWrapper data-testid="current-workspace">
<Avatar alt="Affine" src={currentWorkspace?.meta.avatar || ''} />
<WorkspaceName>
{currentWorkspace?.meta.name ||
+19
View File
@@ -4,6 +4,25 @@ import { loadPage } from './libs/load-page';
loadPage();
test.describe('Open contact us', () => {
test('Click about us', async ({ page }) => {
page.waitForTimeout(1000);
const currentWorkspace = page.getByTestId('current-workspace');
await currentWorkspace.click();
await page
.getByRole('tooltip', {
name: 'A AFFiNE Log in to sync with affine About AFFiNE',
})
.locator('div')
.filter({ hasText: 'About AFFiNE' })
.nth(2)
.click();
const contactUsModal = page.locator(
'[data-testid=contact-us-modal-content]'
);
await expect(contactUsModal).toContainText('AFFiNE Community');
});
test('Click right-bottom corner contact icon', async ({ page }) => {
page.waitForTimeout(1000);
const faqIcon = page.locator('[data-testid=faq-icon]');