Skip to content

Commit 7eac81c

Browse files
committed
NOT FOR LANDING: a probe that writes the CI failure's start time and compares its read back to six digits (green with the change)
1 parent afa60a0 commit 7eac81c

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎packages/core/src/motion/__tests__/animatedLayout.interaction.browser.spec.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,28 @@ test.describe('spec:AST-105 Coverage', () => {
10181018
expect(run.copy).toBeCloseTo(run.startedAt, 6);
10191019
});
10201020

1021+
test('NOT FOR LANDING: a start time read back matches the one written to six digits', async ({
1022+
page,
1023+
}) => {
1024+
await open(
1025+
page,
1026+
`<div id="area" class="area"><div id="grow" class="grow"></div></div>`,
1027+
);
1028+
const run = await page.evaluate(() => {
1029+
const element = document.querySelector('#grow') as HTMLElement;
1030+
const animation = element.animate([{opacity: 0}, {opacity: 1}], 1000);
1031+
// The change's start from the CI failure; it read back as 63.79999999998835.
1032+
const written = 63.79999999998836;
1033+
animation.startTime = written;
1034+
return {written, read: Number(animation.startTime)};
1035+
});
1036+
test.info().annotations.push({
1037+
type: 'the start written and read back',
1038+
description: JSON.stringify(run),
1039+
});
1040+
expect(run.read).toBeCloseTo(run.written, 6);
1041+
});
1042+
10211043
test('a change begun after a block that follows an earlier layout motion, with nothing run between them, still shows its motion', async ({
10221044
page,
10231045
}) => {

0 commit comments

Comments
 (0)