Skip to content

Commit ca6d85c

Browse files
committed
NOT FOR LANDING: a probe that writes the CI failure's start time and compares its read back exactly (red-first evidence)
1 parent df0e60e commit ca6d85c

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
@@ -1014,6 +1014,28 @@ test.describe('spec:AST-105 Coverage', () => {
10141014
expect(run.copy).toBe(run.startedAt);
10151015
});
10161016

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

0 commit comments

Comments
 (0)