(core) Storing last position for doc and user

Summary: Last position should be stored for document and user.

Test Plan: Updated tests

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3143
This commit is contained in:
Jarosław Sadziński
2021-11-18 23:54:37 +01:00
parent c6aa9b65d4
commit fc50079e03
3 changed files with 35 additions and 15 deletions

View File

@@ -1838,6 +1838,20 @@ export async function getEnabledOptions(): Promise<SortOption[]> {
return options;
}
/**
* Runs action in a separate tab, closing the tab after.
* In case of an error tab is not closed, consider using cleanupExtraWindows
* on whole test suit if needed.
*/
export async function onNewTab(action: () => Promise<void>) {
await driver.executeScript("return window.open('about:blank', '_blank')");
const tabs = await driver.getAllWindowHandles();
await driver.switchTo().window(tabs[tabs.length - 1]);
await action();
await driver.close();
await driver.switchTo().window(tabs[tabs.length - 2]);
}
} // end of namespace gristUtils
stackWrapOwnMethods(gristUtils);