(core) Avoid clashes with rick rowing and tours

Summary:
In certain scenarios, it's possible for a Grist tour and a tip that kicks off
an easter egg to be shown on screen at the same time. To deconflict, we
now check for the presence of one or the other and avoid showing both.

Test Plan: Browser tests.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3840
This commit is contained in:
George Gevoian
2023-03-29 09:45:19 -04:00
parent 58ef8d59b5
commit 5b2fb62627
3 changed files with 79 additions and 51 deletions

View File

@@ -224,6 +224,16 @@ describe('DocTutorial', function () {
assert.isTrue(await driver.find('.test-doc-tutorial-popup-footer').isDisplayed());
});
it('does not play an easter egg when opening an anchor link encoded with rr', async function() {
await gu.getCell({rowNum: 1, col: 0}).click();
const link = await gu.getAnchor();
const easterEggLink = link.replace('r1', 'rr1');
await driver.get(easterEggLink);
await gu.waitForAnchor();
assert.isFalse(await driver.find('.test-behavioral-prompt').isPresent());
await gu.assertIsRickRowing(false);
});
it('remembers the last slide the user had open', async function() {
await driver.find('.test-doc-tutorial-popup-slide-3').click();
// There's a 1000ms debounce in place for updates to the last slide.

View File

@@ -3012,6 +3012,15 @@ export async function skipWelcomeQuestions() {
}
}
/**
* Asserts whether a video of Never Gonna Give You Up is playing in the background.
*/
export async function assertIsRickRowing(expected: boolean) {
assert.equal(await driver.find('.test-gristdoc-stop-rick-rowing').isPresent(), expected);
assert.equal(await driver.find('.test-gristdoc-background-video').isPresent(), expected);
assert.equal(await driver.find('iframe#youtube-player-dQw4w9WgXcQ').isPresent(), expected);
}
} // end of namespace gristUtils
stackWrapOwnMethods(gristUtils);