mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
test(columnDesc): create column description simple test
This commit is contained in:
parent
bd9c9aa8f9
commit
e46b93d57f
@ -119,6 +119,7 @@ export function buildDescriptionConfig(
|
||||
await origColumn.description.saveOnly(elem.value);
|
||||
editedDescription.set('');
|
||||
}),
|
||||
testId('column-description'),
|
||||
)
|
||||
),
|
||||
|
||||
|
43
test/nbrowser/DescriptionColumn.ts
Normal file
43
test/nbrowser/DescriptionColumn.ts
Normal file
@ -0,0 +1,43 @@
|
||||
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');
|
||||
|
||||
await getDescriptionInput().click()
|
||||
|
||||
// Remove the description
|
||||
await api.applyUserActions(docId, [
|
||||
[ 'ModifyColumn', 'Table1', 'C', {
|
||||
description: ''
|
||||
} ],
|
||||
]);
|
||||
|
||||
assert.equal(await getDescriptionInput().value(), '');
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue
Block a user