(core) updates from grist-core

This commit is contained in:
Paul Fitzpatrick
2023-05-30 08:32:34 -04:00
46 changed files with 700 additions and 257 deletions

View File

@@ -12,9 +12,7 @@ describe('DescriptionWidget', function() {
await mainSession.tempDoc(cleanup, "CardView.grist", { load: true });
const newWidgetDesc = "This is the widget description\nIt is in two lines";
await driver.find('.test-right-opener').click();
// Sleep 100ms to let open the right panel and make the description input clickable
await driver.sleep(100);
await gu.toggleSidePanel('right', 'open');
const rightPanelDescriptionInput = await driver.find('.test-right-panel .test-right-widget-description');
await rightPanelDescriptionInput.click();
await rightPanelDescriptionInput.sendKeys(newWidgetDesc);

View File

@@ -2,7 +2,8 @@ import {DocCreationInfo} from 'app/common/DocListAPI';
import {UserAPI} from 'app/common/UserAPI';
import {assert, driver, Key} from 'mocha-webdriver';
import * as gu from 'test/nbrowser/gristUtils';
import {setupTestSuite} from 'test/nbrowser/testUtils';
import {server, setupTestSuite} from 'test/nbrowser/testUtils';
import {EnvironmentSnapshot} from 'test/server/testUtils';
describe('DocTutorial', function () {
this.timeout(30000);
@@ -11,10 +12,14 @@ describe('DocTutorial', function () {
let doc: DocCreationInfo;
let api: UserAPI;
let session: gu.Session;
let oldEnv: EnvironmentSnapshot;
const cleanup = setupTestSuite({team: true});
before(async () => {
oldEnv = new EnvironmentSnapshot();
process.env.GRIST_UI_FEATURES = 'tutorials';
await server.restart();
session = await gu.session().teamSite.user('support').login();
doc = await session.tempDoc(cleanup, 'DocTutorial.grist');
api = session.createHomeApi();
@@ -25,6 +30,11 @@ describe('DocTutorial', function () {
}});
});
after(async function () {
oldEnv.restore();
await server.restart();
});
describe('when logged out', function () {
before(async () => {
session = await gu.session().anon.login();

View File

@@ -30,7 +30,7 @@ describe('Features', function () {
});
it('can be disabled with the GRIST_HIDE_UI_ELEMENTS env variable', async function () {
delete process.env.GRIST_UI_FEATURES;
process.env.GRIST_UI_FEATURES = 'helpCenter,tutorials';
process.env.GRIST_HIDE_UI_ELEMENTS = 'templates';
await server.restart();
await session.loadDocMenu('/');
@@ -39,7 +39,7 @@ describe('Features', function () {
assert.isFalse(await driver.find('.test-dm-templates-page').isDisplayed());
});
it('that are disabled take precedence if also enabled', async function () {
it('that are disabled take precedence over those that are also enabled', async function () {
process.env.GRIST_UI_FEATURES = 'tutorials,templates';
process.env.GRIST_HIDE_UI_ELEMENTS = 'helpCenter,templates';
await server.restart();

View File

@@ -16,7 +16,6 @@ import {
HostedStorageOptions
} from 'app/server/lib/HostedStorageManager';
import log from 'app/server/lib/log';
import {fromCallback} from 'app/server/lib/serverUtils';
import {SQLiteDB} from 'app/server/lib/SQLiteDB';
import * as bluebird from 'bluebird';
import {assert} from 'chai';
@@ -957,9 +956,9 @@ describe('backupSqliteDatabase', async function() {
// Silly code to make a long random string to insert.
// We can make a big db faster this way.
const str = (new Array(100)).fill(1).map((_: any) => Math.random().toString(2)).join();
stmt.run(str, str, str);
await stmt.run(str, str, str);
}
await fromCallback(cb => stmt.finalize(cb));
await stmt.finalize();
});
const stat = await fse.stat(src);
assert(stat.size > 150 * 1000 * 1000);