From 3f966f613bb33e34d1a37b1f36b921cde9c1972a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ann=20=E6=9D=8F=20Kilzer?= Date: Sat, 6 Jul 2024 23:39:51 +0900 Subject: [PATCH] test page when switching to japanese --- e2e/team.spec.ts | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/e2e/team.spec.ts b/e2e/team.spec.ts index c6d3c11..cff54f8 100644 --- a/e2e/team.spec.ts +++ b/e2e/team.spec.ts @@ -16,7 +16,7 @@ async function verifyTeamMemberCard(card: Locator, name: string, title?: string) await expect(photo).toHaveAttribute('alt-text', `${name} photo`) } -test('shows the team', async ({ page }) => { +test('shows the team in English', async ({ page }) => { await page.goto('/#/team') const teamContainer = page.getByLabel('team-container') @@ -44,3 +44,32 @@ test('shows the team', async ({ page }) => { await expect(annLink).toHaveAttribute('href', 'https://annkilzer.net') await expect(annLink).toHaveAttribute('target', '_blank') }); + +test('shows the team in Japanese', async ({ page }) => { + await page.goto('/#/team') + + // switch locale to Japanese + const hamburger = page.getByLabel('drawer-toggle-button') + await hamburger.click() + const japanese = page.getByLabel('drawer').getByText('日本語') + await japanese.click() + + const teamContainer = page.getByLabel('team-container') + + // click off to close sidebar + await teamContainer.click({ force: true }); + + const heading = teamContainer.getByText('✨ リーダーシップ・チーム ✨') + await expect(heading).toBeVisible() + + const cards = await teamContainer.getByLabel('team-member-card').all() + expect(cards).toHaveLength(7) + + await verifyTeamMemberCard(cards[0], 'キルザー·杏', 'ディレクター') + await verifyTeamMemberCard(cards[1], 'Paty Cortez', '') + await verifyTeamMemberCard(cards[2], 'Maria Tenorio', '') + await verifyTeamMemberCard(cards[3], 'バジェニナ・ダリヤ', 'ML&データサイエンス・リード') + await verifyTeamMemberCard(cards[4], 'ブレサー クリザ', 'リード') + await verifyTeamMemberCard(cards[5], 'Anna Nakayama', '') + await verifyTeamMemberCard(cards[6], 'Aidan Fournier', '') +})