Ensure realtime uses upstream context when available

Eliminate ambiguity when looking for time conductor locator
This commit is contained in:
Shefali 2023-07-19 14:59:07 -07:00 committed by Jesse Mazzella
parent 72c432ffcc
commit f9c5e12a59
2 changed files with 9 additions and 1 deletions

View File

@ -314,7 +314,7 @@ async function _isInEditMode(page, identifier) {
*/
async function setTimeConductorMode(page, isFixedTimespan = true) {
// Click 'mode' button
const timeConductorMode = await page.locator('.c-compact-tc');
const timeConductorMode = await page.locator('.l-shell__time-conductor.c-compact-tc');
await timeConductorMode.click();
await timeConductorMode.locator('.js-mode-button').click();
const modeMenu = await page.locator('.c-conductor__mode-menu .c-super-menu__menu');

View File

@ -299,6 +299,14 @@ class IndependentTimeContext extends TimeContext {
return this.mode;
}
isRealTime() {
if (this.upstreamTimeContext) {
return this.upstreamTimeContext.isRealTime(...arguments);
} else {
return super.isRealTime(...arguments);
}
}
/**
* Causes this time context to follow another time context (either the global context, or another upstream time context)
* This allows views to have their own time context which points to the appropriate upstream context as necessary, achieving nesting.