-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
confirm ttvc is not affected by animation delay (#88)
### Summary I want to ensure that css animations don't affect TTVC in its current implementation, so I've added a small test to verify this ### Test plan can be run with `npx playwright test test/e2e/animation1/index.spec.ts --ui` Co-authored-by: Rich Hong <[email protected]>
- Loading branch information
1 parent
40aa9ce
commit 3d059d3
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<head> | ||
<script src="/dist/index.min.js"></script> | ||
<script src="/analytics.js"></script> | ||
</head> | ||
<style> | ||
@keyframes test-fade-in { | ||
from { | ||
opacity: 0; | ||
} | ||
|
||
to { | ||
opacity: 1; | ||
} | ||
} | ||
</style> | ||
|
||
<body> | ||
<div style="opacity: 0; animation: test-fade-in 300ms 3000ms forwards">Delayed animation</div> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {test, expect} from '@playwright/test'; | ||
|
||
import {getEntriesAndErrors} from '../../util/entries'; | ||
|
||
const ANIMATION_DELAY = 3000; | ||
|
||
test.describe('TTVC', () => { | ||
test('an animation delay', async ({page}) => { | ||
await page.goto(`/test/animation1`, { | ||
waitUntil: 'networkidle', | ||
}); | ||
|
||
const {entries} = await getEntriesAndErrors(page); | ||
|
||
expect(entries.length).toBe(1); | ||
expect(entries[0].duration).toBeLessThan(ANIMATION_DELAY); | ||
}); | ||
}); |