Skip to content

Commit 76783f8

Browse files
committed
Refactor Computers animation e2e tests to Terraform animation
1 parent a456f44 commit 76783f8

8 files changed

Lines changed: 16 additions & 1511 deletions

File tree

src/components/Animations/Computers/client/__tests__/index.spec.ts

Lines changed: 0 additions & 464 deletions
This file was deleted.

src/components/Animations/Computers/client/index.ts

Lines changed: 0 additions & 753 deletions
This file was deleted.

src/components/Animations/Computers/client/selectors.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/components/Animations/Computers/index.astro

Lines changed: 0 additions & 257 deletions
This file was deleted.

src/components/Home/Backstage/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface Props {
2020
}[]
2121
}
2222
23-
const { pretitle, title, description, benefits, features } = Astro.props as Props
23+
const { pretitle, description, benefits, features } = Astro.props as Props
2424
2525
const svgPath = {
2626
'left-justified': 'M4 6h16M4 12h16M4 18h7',
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
import BaseLayout from '@layouts/BaseLayout.astro'
3-
import ComputersAnimation from '@components/Animations/Computers/index.astro'
3+
import TerraformAnimation from '@components/Animations/Terraform/index.astro'
44
5-
const pageTitle = 'Computers Animation Fixture'
5+
const pageTitle = 'Terraform Animation Fixture'
66
const pageDescription =
7-
'Isolated test route for the hero computers animation and its lifecycle controller.'
8-
const pagePath = '/testing/animations-computers'
7+
'Isolated test route for the hero terraform animation and its lifecycle controller.'
8+
const pagePath = '/testing/animations-terraform'
99
---
1010

1111
<BaseLayout pageTitle={pageTitle} description={pageDescription} path={pagePath} noindex>
1212
<section class="mx-auto mb-12 max-w-4xl space-y-4 text-lg">
1313
<p>
14-
This dedicated route hosts the hero computers animation inside a stable shell so automated
14+
This dedicated route hosts the hero terraform animation inside a stable shell so automated
1515
tests can validate pause and play semantics without relying on home page content or layout
1616
changes.
1717
</p>
@@ -22,6 +22,6 @@ const pagePath = '/testing/animations-computers'
2222
</section>
2323

2424
<div class="mx-auto flex max-w-4xl items-center justify-center">
25-
<ComputersAnimation />
25+
<TerraformAnimation />
2626
</div>
2727
</BaseLayout>

test/e2e/POM_METHOD_USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ has navigateToDiagnosticsPage and getSnapshot:
453453

454454
- test/e2e/specs/01-smoke/dynamic-pages.spec.ts
455455
- test/e2e/specs/02-pages/services.spec.ts
456-
- test/e2e/specs/04-components/animations-computers.spec.ts
456+
- test/e2e/specs/04-components/animations-terraform.spec.ts
457457
- test/e2e/specs/04-components/carousel.spec.ts
458458
- test/e2e/specs/04-components/consentBanner.spec.ts
459459
- test/e2e/specs/04-components/footer.spec.ts

test/e2e/specs/04-components/animations-computers.spec.ts renamed to test/e2e/specs/04-components/animations-terraform.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Page } from '@playwright/test'
44
type AnimationPlayState = 'playing' | 'paused' | null
55

66
const selectors = {
7-
host: 'computers-animation',
7+
host: 'terraform-animation',
88
toggle: '[data-animation-toggle]',
99
}
1010

@@ -19,10 +19,10 @@ const isMobileProject = (projectName: string): boolean => {
1919
return projectName.startsWith('mobile-')
2020
}
2121

22-
async function loadComputersFixture(playwrightPage: Page, options: FixtureOptions = {}): Promise<BasePage> {
22+
async function loadTerraformFixture(playwrightPage: Page, options: FixtureOptions = {}): Promise<BasePage> {
2323
const page = await BasePage.init(playwrightPage)
2424
await page.page.emulateMedia({ reducedMotion: options.reducedMotion ?? 'no-preference' })
25-
await page.goto('/testing/animations-computers')
25+
await page.goto('/testing/animations-terraform')
2626
// NOTE: The component is intentionally `hidden lg:flex` in production markup.
2727
// On mobile projects it will remain hidden, so waiting for "visible" will hang.
2828
await page.waitForSelector(selectors.host, { state: 'attached' })
@@ -32,7 +32,7 @@ async function loadComputersFixture(playwrightPage: Page, options: FixtureOption
3232

3333
async function getAnimationState(page: BasePage): Promise<AnimationPlayState> {
3434
return await page.evaluate(() => {
35-
return document.querySelector('computers-animation')?.getAttribute('data-animation-state') as AnimationPlayState
35+
return document.querySelector('terraform-animation')?.getAttribute('data-animation-state') as AnimationPlayState
3636
})
3737
}
3838

@@ -56,9 +56,9 @@ async function setOverlayPause(page: BasePage, isPaused: boolean): Promise<void>
5656
}, { paused: isPaused, source: overlaySource })
5757
}
5858

59-
test.describe('Computers Animation Component', () => {
59+
test.describe('Terraform Animation Component', () => {
6060
test('plays by default when no pause sources exist', async ({ page: playwrightPage }, testInfo) => {
61-
const page = await loadComputersFixture(playwrightPage)
61+
const page = await loadTerraformFixture(playwrightPage)
6262
const host = page.locator(selectors.host)
6363
const toggle = page.locator(selectors.toggle)
6464

@@ -77,7 +77,7 @@ test.describe('Computers Animation Component', () => {
7777
})
7878

7979
test('honors prefers-reduced-motion by starting paused', async ({ page: playwrightPage }, testInfo) => {
80-
const page = await loadComputersFixture(playwrightPage, { reducedMotion: 'reduce' })
80+
const page = await loadTerraformFixture(playwrightPage, { reducedMotion: 'reduce' })
8181
const host = page.locator(selectors.host)
8282

8383
await waitForAnimationState(page, 'paused')
@@ -96,7 +96,7 @@ test.describe('Computers Animation Component', () => {
9696
test(
9797
'responds to overlay pause and resume actions from the animation store',
9898
async ({ page: playwrightPage }, testInfo) => {
99-
const page = await loadComputersFixture(playwrightPage)
99+
const page = await loadTerraformFixture(playwrightPage)
100100
const host = page.locator(selectors.host)
101101

102102
// On mobile projects the component is intentionally `hidden lg:flex` and must not start.

0 commit comments

Comments
 (0)