Skip to content

Commit 274b396

Browse files
committed
chore(AnalyticalTable): remove unused code & fix test
1 parent 4650995 commit 274b396

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -638,28 +638,6 @@ describe('AnalyticalTable', () => {
638638
cy.findByTestId('payloadRowsById').should('have.text', '{}');
639639
cy.findByTestId('payloadAllRowsSelected').should('have.text', 'false');
640640

641-
// Space (keyup) + ArrowDown => 1st row selected
642-
cy.get('[data-row-index="0"][data-column-index="0"]').realPress(['Space', 'ArrowDown']);
643-
cy.get('@onRowSelectSpy').should('have.callCount', 8);
644-
cy.findByTestId('payload').should('have.text', '["0"]');
645-
cy.findByTestId('payloadRowsById').should('have.text', '{"0":true}');
646-
cy.findByTestId('payloadAllRowsSelected').should('have.text', 'false');
647-
648-
// Space (keyup) + ArrowUp => all rows selected
649-
cy.get('[data-row-index="0"][data-column-index="0"]').realPress(['Space', 'ArrowUp']);
650-
cy.get('@onRowSelectSpy').should('have.callCount', 9);
651-
cy.findByTestId('payload').should(
652-
'have.text',
653-
'["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"]'
654-
);
655-
cy.findByTestId('payloadRowsById').should(
656-
'have.text',
657-
'{"0":true,"1":true,"2":true,"3":true,"4":true,"5":true,"6":true,"7":true,"8":true,"9":true,"10":true,"11":true,"12":true,"13":true,"14":true,"15":true,"16":true,"17":true,"18":true,"19":true,"20":true}'
658-
);
659-
cy.findByTestId('payloadAllRowsSelected').should('have.text', 'true');
660-
661-
cy.get('[data-row-index="0"][data-column-index="0"]').click();
662-
663641
cy.findByText('Name-0').click();
664642
cy.findByText('Name-1').click();
665643
cy.findByText('Name-5').click();
@@ -670,7 +648,7 @@ describe('AnalyticalTable', () => {
670648
cy.findByTestId('payloadAllRowsSelected').should('have.text', 'false');
671649

672650
cy.get('[data-row-index="0"][data-column-index="0"]').click();
673-
cy.get('@onRowSelectSpy').should('have.callCount', 14);
651+
cy.get('@onRowSelectSpy').should('have.callCount', 11);
674652
cy.findByTestId('payload').should('have.text', '["0","1","5","7","17","20"]');
675653
cy.findByTestId('payloadRowsById').should('have.text', '{"0":true,"1":true,"5":true,"7":true,"17":true,"20":true}');
676654
cy.findByTestId('payloadAllRowsSelected').should('have.text', 'false');
@@ -725,7 +703,7 @@ describe('AnalyticalTable', () => {
725703
'{"0":true,"1":true,"2":true,"3":true,"4":true,"5":true,"6":true,"7":true,"8":true,"9":true,"10":true,"11":true,"12":true,"13":true,"14":true,"15":true,"16":true,"17":true,"18":true,"19":true,"20":true}'
726704
);
727705
cy.findByTestId('payloadAllRowsSelected').should('have.text', 'true');
728-
cy.get('@onRowSelectSpy').should('have.callCount', 19);
706+
cy.get('@onRowSelectSpy').should('have.callCount', 16);
729707
});
730708

731709
it('row & header height', () => {

packages/main/src/components/AnalyticalTable/ColumnHeader/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export interface ColumnHeaderProps {
4545
id: string;
4646
onClick: MouseEventHandler<HTMLDivElement> | undefined;
4747
onKeyDown?: KeyboardEventHandler<HTMLDivElement> | undefined;
48-
onKeyUp?: KeyboardEventHandler<HTMLDivElement> | undefined;
4948
className: string;
5049
style: CSSProperties;
5150
column: ColumnType;
@@ -83,7 +82,6 @@ export const ColumnHeader = (props: ColumnHeaderProps) => {
8382
onClick,
8483
onKeyDown,
8584
portalContainer,
86-
onKeyUp,
8785
isFiltered,
8886
title,
8987
'aria-label': ariaLabel,
@@ -157,9 +155,6 @@ export const ColumnHeader = (props: ColumnHeaderProps) => {
157155
};
158156

159157
const handleHeaderCellKeyUp = (e) => {
160-
if (typeof onKeyUp === 'function') {
161-
onKeyUp(e);
162-
}
163158
if (hasPopover && e.code === 'Space' && !e.target.hasAttribute('ui5-li')) {
164159
setPopoverOpen(true);
165160
}

0 commit comments

Comments
 (0)