Skip to content

Commit

Permalink
test page when switching to japanese
Browse files Browse the repository at this point in the history
  • Loading branch information
ann-kilzer committed Jul 6, 2024
1 parent 15580b6 commit 3f966f6
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion e2e/team.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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', '')
})

0 comments on commit 3f966f6

Please sign in to comment.