Skip to content

Commit a761e5d

Browse files
committed
feat: checkbox e2e test
1 parent b27cbc7 commit a761e5d

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

packages/ketchup/src/components/kup-input-panel/kup-input-panel.e2e.ts

+53
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,57 @@ describe('kup-input-panel', () => {
270270
const updatedValue = await input.getProperty('value');
271271
expect(updatedValue).toBe('Italy');
272272
});
273+
274+
it('renders checkbox', async () => {
275+
const page = await newE2EPage();
276+
277+
await page.setContent(
278+
'<kup-input-panel></kup-input-panel> <div kup-dynamic-position></div>'
279+
);
280+
const inputPanel = await page.find('kup-input-panel');
281+
const data = {
282+
columns: [
283+
{
284+
name: 'CHK',
285+
title: 'Checkbox',
286+
visible: true,
287+
},
288+
],
289+
rows: [
290+
{
291+
cells: {
292+
CHK: {
293+
value: 'off',
294+
editable: true,
295+
shape: 'CHK',
296+
},
297+
},
298+
},
299+
],
300+
};
301+
302+
inputPanel.setProperty('data', data);
303+
304+
await page.waitForChanges();
305+
306+
const inputPanelContent = await page.find(
307+
'kup-input-panel >>> form.input-panel'
308+
);
309+
expect(inputPanelContent).not.toBeNull();
310+
311+
const checkboxCell = await inputPanelContent.find(
312+
'.f-cell.checkbox-cell'
313+
);
314+
expect(checkboxCell).not.toBeNull();
315+
316+
const label = await checkboxCell.find('label');
317+
expect(label).not.toBeNull();
318+
expect(label).toEqualText(data.columns[0].title);
319+
320+
const input = await checkboxCell.find('input');
321+
expect(input).not.toBeNull();
322+
323+
const value = await input.getProperty('value');
324+
expect(value).toBe('off');
325+
});
273326
});

0 commit comments

Comments
 (0)