Skip to content

Commit cadb555

Browse files
authored
Merge pull request #771 from Lemoncode/feature/#607-multiple-selection-no-common-props
Feature/#607 multiple selection no common props
2 parents 64694b4 + 0081392 commit cadb555

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

e2e/helpers/properties.helpers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@ export const checkPropertiesExist = async (
1919
await expect(propLocator).toBeVisible();
2020
}
2121
};
22+
23+
export const checkPropertiesDoNotExist = async (
24+
page: Page,
25+
properties: string[]
26+
) => {
27+
for (const property of properties) {
28+
const propLocator = page.getByText(property, { exact: true });
29+
await expect(propLocator).not.toBeVisible();
30+
}
31+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { test, expect } from '@playwright/test';
2+
import {
3+
addComponentsWithDifferentCategoriesToCanvas,
4+
checkPropertiesDoNotExist,
5+
checkPropertiesExist,
6+
ComponentWithCategory,
7+
getTransformer,
8+
selectAllComponentsInCanvas,
9+
} from '../helpers';
10+
11+
test('when selecting button and bar chart, check that there are not common props (just default layering prop)', async ({
12+
page,
13+
}) => {
14+
page.goto('');
15+
16+
// Add components to canvas
17+
const components: ComponentWithCategory[] = [
18+
{ name: 'Button' },
19+
{ name: 'Bar Chart', category: 'Rich Components' },
20+
];
21+
await addComponentsWithDifferentCategoriesToCanvas(page, components);
22+
23+
// Select all components in canvas
24+
await selectAllComponentsInCanvas(page);
25+
26+
// Confirm both items are selected
27+
const selectedItems = await getTransformer(page);
28+
expect(selectedItems._nodes.length).toEqual(2);
29+
30+
const buttonProps: string[] = [
31+
'Stroke',
32+
'Stroke style',
33+
'Background',
34+
'TextColor',
35+
'Disabled',
36+
'Border-radius',
37+
];
38+
39+
// Verify button props are not visible in the properties panel
40+
await checkPropertiesDoNotExist(page, buttonProps);
41+
42+
// Verify layering prop to be visible
43+
44+
await checkPropertiesExist(page, ['Layering']);
45+
});

0 commit comments

Comments
 (0)