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 Dec 28, 2022
1 parent 70cd55f commit a6e0919
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 } = require('../../appActions.js');
const { createDomainObjectWithDefaults, expandEntireTree } = require('../../appActions.js');

test.describe('AppActions', () => {
test('createDomainObjectsWithDefaults', async ({ page }) => {
Expand Down Expand Up @@ -85,4 +85,38 @@ test.describe('AppActions', () => {
expect(folder3.url).toBe(`${e2eFolder.url}/${folder1.uuid}/${folder2.uuid}/${folder3.uuid}`);
});
});
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 a6e0919

Please sign in to comment.