mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add + button to the filter section of the section menu
Test Plan: adds new browser tests Reviewers: paulfitz Reviewed By: paulfitz Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D2781
This commit is contained in:
@@ -875,6 +875,25 @@ export async function toggleSidePanel(which: 'right'|'left', goal: 'open'|'close
|
||||
await driver.sleep((transitionDuration + delta) * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles (opens or closes) the filter bar for a section.
|
||||
*/
|
||||
export async function toggleFilterBar(goal: 'open'|'close'|'toggle' = 'toggle',
|
||||
options: {section?: string|WebElement, save?: boolean} = {}) {
|
||||
const isOpen = await driver.find('.test-filter-bar').isPresent();
|
||||
if ((goal === 'close') && !isOpen ||
|
||||
(goal === 'open') && isOpen ) {
|
||||
return;
|
||||
}
|
||||
const menu = await openSectionMenu(options.section);
|
||||
await menu.findContent('.grist-floating-menu > div', /Toggle Filter Bar/).find('.test-section-menu-btn').click();
|
||||
if (options.save) {
|
||||
await menu.findContent('.grist-floating-menu button', /Save/).click();
|
||||
await waitForServer();
|
||||
}
|
||||
await menu.sendKeys(Key.ESCAPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the section menu for a section, or the active section if no section is given.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user