Browse Source

fix tests

pull/4656/head
Ekaterina Balakina 2 years ago
parent
commit
f869c8fdc6
  1. 26
      tests/playwright/tests/cellSelection.spec.ts

26
tests/playwright/tests/cellSelection.spec.ts

@ -14,36 +14,34 @@ test.describe('Verify cell selection', () => {
}); });
test('#1 when range is selected, it has correct number of selected cells', async () => { test('#1 when range is selected, it has correct number of selected cells', async () => {
await dashboard.treeView.openTable({ title: 'Country' }); await dashboard.treeView.openTable({ title: 'Customer' });
await grid.selectRange({ await grid.selectRange({
start: { index: 0, columnHeader: 'Country' }, start: { index: 0, columnHeader: 'FirstName' },
end: { index: 2, columnHeader: 'City List' }, end: { index: 2, columnHeader: 'Email' },
}); });
expect(await grid.selectedCount()).toBe(9); expect(await grid.selectedCount()).toBe(9);
}); });
test('#2 when copied with clipboard, it copies correct text', async () => { test('#2 when copied with clipboard, it copies correct text', async () => {
await dashboard.treeView.openTable({ title: 'Country' }); await dashboard.treeView.openTable({ title: 'Customer' });
await grid.selectRange({ await grid.selectRange({
start: { index: 0, columnHeader: 'Country' }, start: { index: 0, columnHeader: 'FirstName' },
end: { index: 1, columnHeader: 'LastUpdate' }, end: { index: 1, columnHeader: 'LastName' },
}); });
expect(await grid.copyWithKeyboard()).toBe( expect(await grid.copyWithKeyboard()).toBe('MARY \t SMITH\n' + ' PATRICIA \t JOHNSON\n');
'Afghanistan \t 2006-02-15 04:44:00\n' + ' Algeria \t 2006-02-15 04:44:00\n'
);
}); });
test('#3 when copied with mouse, it copies correct text', async () => { test('#3 when copied with mouse, it copies correct text', async () => {
await dashboard.treeView.openTable({ title: 'Country' }); await dashboard.treeView.openTable({ title: 'Customer' });
await grid.selectRange({ await grid.selectRange({
start: { index: 0, columnHeader: 'Country' }, start: { index: 0, columnHeader: 'FirstName' },
end: { index: 1, columnHeader: 'LastUpdate' }, end: { index: 1, columnHeader: 'LastName' },
}); });
expect(await grid.copyWithMouse({ index: 0, columnHeader: 'Country' })).toBe( expect(await grid.copyWithMouse({ index: 0, columnHeader: 'FirstName' })).toBe(
'Afghanistan \t 2006-02-15 04:44:00\n' + ' Algeria \t 2006-02-15 04:44:00\n' 'MARY \t SMITH\n' + ' PATRICIA \t JOHNSON\n'
); );
}); });

Loading…
Cancel
Save