fix(#7791): tc form shouldn't submit bounds changes on dismiss (#7792)

* fix(#7791): tc form shouldn't submit bounds changes on dismiss

* test(e2e): add tests for validating time conductor popup

- update appAction for setting time conductor in fixed mode
- add a11y to time conductor in fixed mode
- update tests using `setTimeConductorBounds`

* fix(#7791): actually fix the problem. Also, add a test.

* test: add annotation to regression test

* docs: comments

* test: fix the reset image button flake ONCE AND FOR ALL

- wait for the rightmost image thumbnail to be in the viewport :D

* test: add tests for `setTimeConductorMode` and `setTimeConductorBounds`
This commit is contained in:
Jesse Mazzella
2024-07-25 16:55:50 -07:00
committed by GitHub
parent 689f7cc815
commit e3fcbe1a35
10 changed files with 302 additions and 172 deletions

View File

@ -112,13 +112,14 @@ test.describe('Telemetry Table', () => {
// Subtract 5 minutes from the current end bound datetime and set it
// Bring up the time conductor popup
let endDate = await page.locator('[aria-label="End bounds"]').textContent();
endDate = new Date(endDate);
let endTimeStamp = await page.getByLabel('End bounds').textContent();
endTimeStamp = new Date(endTimeStamp);
endDate.setUTCMinutes(endDate.getUTCMinutes() - 5);
endDate = endDate.toISOString().replace(/T/, ' ');
endTimeStamp.setUTCMinutes(endTimeStamp.getUTCMinutes() - 5);
const endDate = endTimeStamp.toISOString().split('T')[0];
const endTime = endTimeStamp.toISOString().split('T')[1];
await setTimeConductorBounds(page, undefined, endDate);
await setTimeConductorBounds(page, { endDate, endTime });
await expect(tableWrapper).not.toHaveClass(/is-paused/);
@ -131,7 +132,7 @@ test.describe('Telemetry Table', () => {
// Verify that it is <= our new end bound
const latestMilliseconds = Date.parse(latestTelemetryDate);
const endBoundMilliseconds = Date.parse(endDate);
const endBoundMilliseconds = Date.parse(endTimeStamp);
expect(latestMilliseconds).toBeLessThanOrEqual(endBoundMilliseconds);
});