Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

test: add test case for language menu

JimmFly1ea0e29d9309
diff --git a/packages/app/src/components/workspace-modal/SelectLanguageMenu.tsx b/packages/app/src/components/workspace-modal/SelectLanguageMenu.tsx
index ad579e145b..47e4ae02a8 100644
--- a/packages/app/src/components/workspace-modal/SelectLanguageMenu.tsx
+++ b/packages/app/src/components/workspace-modal/SelectLanguageMenu.tsx
@@ -45,6 +45,7 @@ export const LanguageMenu = () => {
iconPosition="end"
noBorder={true}
style={{ textTransform: 'capitalize' }}
+ data-testid="language-menu-button"
>
{currentLanguage?.originalName}
</Button>
diff --git a/tests/local-first-workspace.spec.ts b/tests/local-first-workspace.spec.ts
index 7a2e26b3d1..abb4745a01 100644
--- a/tests/local-first-workspace.spec.ts
+++ b/tests/local-first-workspace.spec.ts
@@ -17,3 +17,12 @@ test.describe('Local first default workspace', () => {
).not.toBeNull();
});
});
+test.describe('Language switch', () => {
+ test('Open language switch menu', async ({ page }) => {
+ await page.getByTestId('current-workspace').click();
+ const languageMenuButton = page.getByTestId('language-menu-button');
+ await expect(languageMenuButton).toBeVisible();
+ const actual = await languageMenuButton.innerText();
+ expect(actual).toEqual('English');
+ });
+});