mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
3dadf93c98
Summary: The new "copyDoc" query parameter on the login page sets a short-lived cookie, which is then read when welcoming a new user to copy that document to their Home workspace, and redirect to it. Currently, only templates and bare forks set this parameter. A new API endpoint for copying a document to a workspace was also added. Test Plan: Browser tests. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3992
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
/**
|
|
*
|
|
* This is a minimal test to make sure documents can be created, edited, and
|
|
* reopened. Grist has a very extensive test set that has not yet been ported
|
|
* to the grist-core.
|
|
*
|
|
*/
|
|
|
|
import { assert, driver } from 'mocha-webdriver';
|
|
import { server, setupTestSuite } from 'test/nbrowser/testUtils';
|
|
import * as gu from 'test/nbrowser/gristUtils';
|
|
|
|
async function openMainPage() {
|
|
await driver.get(`${server.getHost()}`);
|
|
while (true) { // eslint-disable-line no-constant-condition
|
|
try {
|
|
if (await driver.findContent('button', /Create Empty Document/).isPresent()) {
|
|
return;
|
|
}
|
|
} catch (e) {
|
|
// don't worry about transients.
|
|
}
|
|
await driver.sleep(10);
|
|
}
|
|
}
|
|
|
|
describe("Smoke", function() {
|
|
this.timeout(20000);
|
|
setupTestSuite();
|
|
|
|
it('can create, edit, and reopen a document', async function() {
|
|
this.timeout(20000);
|
|
await openMainPage();
|
|
await driver.findContent('button', /Create Empty Document/).click();
|
|
await gu.waitForDocToLoad(20000);
|
|
await gu.dismissWelcomeTourIfNeeded();
|
|
await gu.getCell('A', 1).click();
|
|
await gu.enterCell('123');
|
|
await gu.refreshDismiss();
|
|
assert.equal(await gu.getCell('A', 1).getText(), '123');
|
|
});
|
|
});
|