(core) Showing a raw data section on a popup

Summary:
Show raw data will now open a popup with
raw section instead of redirecting to raw data page.

Adding new anchor link type "a2" that is able to open
any section in a popup on a current view.

Not related:
Fixing highlightMatches function, after merging core PR.

Test Plan: Updated tests

Reviewers: alexmojaki, georgegevoian

Reviewed By: alexmojaki, georgegevoian

Subscribers: georgegevoian, alexmojaki

Differential Revision: https://phab.getgrist.com/D3592
This commit is contained in:
Jarosław Sadziński
2022-08-24 13:43:15 +02:00
parent 177b9d83d9
commit 2997434815
8 changed files with 186 additions and 67 deletions

View File

@@ -536,16 +536,18 @@ export async function getFormulaText() {
/**
* Check that formula editor is shown and its value matches the given regexp.
*/
export async function checkFormulaEditor(valueRe: RegExp) {
export async function checkFormulaEditor(value: RegExp|string) {
assert.equal(await driver.findWait('.test-formula-editor', 500).isDisplayed(), true);
const valueRe = typeof value === 'string' ? exactMatch(value) : value;
assert.match(await driver.find('.code_editor_container').getText(), valueRe);
}
/**
* Check that plain text editor is shown and its value matches the given regexp.
*/
export async function checkTextEditor(valueRe: RegExp) {
export async function checkTextEditor(value: RegExp|string) {
assert.equal(await driver.findWait('.test-widget-text-editor', 500).isDisplayed(), true);
const valueRe = typeof value === 'string' ? exactMatch(value) : value;
assert.match(await driver.find('.celleditor_text_editor').value(), valueRe);
}
@@ -2384,6 +2386,11 @@ export async function waitForAnchor() {
await driver.wait(async () => (await getTestState()).anchorApplied, 2000);
}
export async function getAnchor() {
await driver.find('body').sendKeys(Key.chord(Key.SHIFT, await modKey(), 'a'));
return (await getTestState()).clipboard || '';
}
export async function getActiveSectionTitle(timeout?: number) {
return await driver.findWait('.active_section .test-viewsection-title', timeout ?? 0).getText();
}