Skip to content

Commit

Permalink
test: add test for expandEntireTree
Browse files Browse the repository at this point in the history
  • Loading branch information
ozyx committed Jan 25, 2023
1 parent a175d3a commit f00024a
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion e2e/tests/framework/appActions.e2e.spec.js
Expand Up @@ -21,7 +21,7 @@
*****************************************************************************/

const { test, expect } = require('../../pluginFixtures.js');
const { createDomainObjectWithDefaults, createNotification } = require('../../appActions.js');
const { createDomainObjectWithDefaults, createNotification, expandEntireTree } = require('../../appActions.js');

test.describe('AppActions', () => {
test('createDomainObjectsWithDefaults', async ({ page }) => {
Expand Down Expand Up @@ -109,4 +109,38 @@ test.describe('AppActions', () => {
await expect(page.locator('.c-message-banner')).toHaveClass(/error/);
await page.locator('[aria-label="Dismiss"]').click();
});
test('expandEntireTree', async ({ page }) => {
await page.goto('./', { waitUntil: 'networkidle' });

const rootFolder = await createDomainObjectWithDefaults(page, {
type: 'Folder'
});
const folder1 = await createDomainObjectWithDefaults(page, {
type: 'Folder',
parent: rootFolder.uuid
});

await createDomainObjectWithDefaults(page, {
type: 'Clock',
parent: folder1.uuid
});
const folder2 = await createDomainObjectWithDefaults(page, {
type: 'Folder',
parent: folder1.uuid
});
await createDomainObjectWithDefaults(page, {
type: 'Display Layout',
parent: folder2.uuid
});
await createDomainObjectWithDefaults(page, {
type: 'Folder',
parent: folder2.uuid
});

await expandEntireTree(page);
const treePane = page.locator('#tree-pane');
const collapsedTreeItems = treePane.locator('role=treeitem[expanded=false]');
const count = await collapsedTreeItems.count();
expect(count).toBe(0);
});
});

0 comments on commit f00024a

Please sign in to comment.