Skip to content

Commit f0e6067

Browse files
test: verify common properties are shown when multiple components are selected
1 parent c463cb7 commit f0e6067

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

e2e/props/multi-select-bg-and-common-props.spec.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
getShapeBackgroundColor,
66
addComponentsWithDifferentCategoriesToCanvas,
77
selectAllComponentsInCanvas,
8+
checkPropertiesExist,
89
} from '../helpers';
910

1011
test('when selecting a button and a rectangle, select both, change background color to red, both should update their bg to red', async ({
@@ -45,3 +46,34 @@ test('when selecting a button and a rectangle, select both, change background co
4546
expect(buttonBgColor).toBe('#DD0000');
4647
expect(rectangleBgColor).toBe('#DD0000');
4748
});
49+
50+
test('verify that in the props we can find the common props of both items', async ({
51+
page,
52+
}) => {
53+
await page.goto('');
54+
55+
// Add components to canvas
56+
const components: ComponentWithCategory[] = [
57+
{ name: 'Button' },
58+
{ name: 'Rectangle', category: 'Basic Shapes' },
59+
];
60+
await addComponentsWithDifferentCategoriesToCanvas(page, components);
61+
62+
// Select all components in canvas
63+
await selectAllComponentsInCanvas(page);
64+
65+
// Confirm both items are selected
66+
const selectedItems = await getTransformer(page);
67+
expect(selectedItems._nodes.length).toEqual(2);
68+
69+
const commonProps: string[] = [
70+
'Layering',
71+
'Stroke',
72+
'Stroke style',
73+
'Background',
74+
'Border-radius',
75+
];
76+
77+
// Verify common properties are visible in the properties panel
78+
await checkPropertiesExist(page, commonProps);
79+
});

0 commit comments

Comments
 (0)