Skip to content

Commit 0081392

Browse files
test: verify that no props are shown when components have no props in common
1 parent 7d83fb9 commit 0081392

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

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)