Ensure time conductor mode is set when synchronizing time range (#7731)

* Use setMode API to set the time span as well as the bounds instead of the old bounds time API.

* Add test for synchronized time conductor via plots

* Fix linting issue
This commit is contained in:
Shefali Joshi
2024-06-03 09:17:41 -07:00
committed by GitHub
parent c354e1c2f1
commit 6360bc4b6c
2 changed files with 35 additions and 2 deletions

View File

@ -25,7 +25,11 @@
*
*/
import { createDomainObjectWithDefaults, getCanvasPixels } from '../../../../appActions.js';
import {
createDomainObjectWithDefaults,
getCanvasPixels,
setRealTimeMode
} from '../../../../appActions.js';
import { expect, test } from '../../../../pluginFixtures.js';
test.describe('Plot Rendering', () => {
@ -50,6 +54,34 @@ test.describe('Plot Rendering', () => {
createMineFolderRequests.push(req);
});
expect(createMineFolderRequests.length).toEqual(0);
await page.getByLabel('Plot Canvas').hover();
});
test('Time conductor synchronizes with plot time range when that plot control is clicked', async ({
page
}) => {
// Navigate to Sine Wave Generator
await page.goto(sineWaveGeneratorObject.url);
// Switch to real-time mode
await setRealTimeMode(page);
// hover over plot for plot controls
await page.getByLabel('Plot Canvas').hover();
// click on pause control
await page.getByTitle('Pause incoming real-time data').click();
// expect plot to be paused
await expect(page.getByTitle('Resume displaying real-time data')).toBeVisible();
// hover over plot for plot controls
await page.getByLabel('Plot Canvas').hover();
// click on synchronize with time conductor
await page.getByTitle('Synchronize Time Conductor').click();
await page.getByRole('button', { name: 'OK', exact: true }).click();
//confirm that you're now in fixed mode with the correct range
await expect(page.getByLabel('Time Conductor Mode')).toHaveText('Fixed Timespan');
});
test.fixme('Plot is rendered when infinity values exist', async ({ page }) => {