You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gristlabs_grist-core/test/nbrowser/DescriptionColumn.ts

42 lines
1.3 KiB

import { assert, driver } from 'mocha-webdriver';
import * as gu from 'test/nbrowser/gristUtils';
import { setupTestSuite } from 'test/nbrowser/testUtils';
function getDescriptionInput() {
return driver.find('.test-right-panel .test-column-description');
}
describe('DescriptionColumn', function() {
this.timeout(20000);
const cleanup = setupTestSuite();
it('should support basic edition', async () => {
const mainSession = await gu.session().teamSite.login();
const api = mainSession.createHomeApi();
const docId = await mainSession.tempNewDoc(cleanup, 'FormulaCounts', { load: true });
// Make a column and add a description
await api.applyUserActions(docId, [
[ 'ModifyColumn', 'Table1', 'C', {
type: 'Text',
description: 'This is the column description \nI am in two lines'
} ],
]);
await driver.find('.test-right-opener').click();
await gu.getCell({ rowNum: 1, col: 'C' }).click();
await driver.find('.test-right-tab-field').click();
assert.equal(await getDescriptionInput().value(), 'This is the column description \nI am in two lines');
// Remove the description
await api.applyUserActions(docId, [
[ 'ModifyColumn', 'Table1', 'C', {
description: ''
} ],
]);
assert.equal(await getDescriptionInput().value(), '');
});
});