Skip to content

test: don't ignore errors #7390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions cypress/support/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,3 @@ import '@testing-library/cypress/add-commands';
import './commands';
import '../../packages/cypress-commands/src/index.js';
import '../../packages/main/dist/Assets.js';

const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/;

Cypress.on(
'uncaught:exception',
/**
*
* @param err
* @returns {boolean}
*/ (err) => {
/* returning false here prevents Cypress from failing the test */
if (resizeObserverLoopErrRe.test(err.message)) {
return false;
}
},
);
301 changes: 203 additions & 98 deletions packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2027,110 +2027,215 @@ describe('AnalyticalTable', () => {
cy.get('@more').should('have.been.calledOnce');
});

it('pop-in columns', () => {
document.body.style.margin = '0px';
if (reactVersion.startsWith('19')) {
['ltr', 'rtl'].forEach((dir) => {
cy.mount(<AnalyticalTable data={data} columns={columnsWithPopIn} dir={dir} />);
cy.viewport(801, 1024);
cy.findByText('Name').should('be.visible');
cy.findByText('Age').should('be.visible');
cy.findByText('Friend Name').should('be.visible');
cy.findByText('Custom original Header1').should('be.visible');
cy.findByText('Custom original Header2').should('be.visible');
cy.findByText('Custom Header').should('be.visible');
cy.findByText('Custom Header').should('be.visible');
cy.findByText('PopinDisplay Modes').should('be.visible').should('have.attr', 'ui5-text');
cy.findAllByTestId('popinCell').should('exist');
cy.contains('Custom Cell 2').should('be.visible');

cy.contains('Custom Header 1').should('not.exist');
cy.contains('Custom Header 2').should('not.exist');
cy.contains('pop-in content').should('not.exist');

cy.viewport(800, 1024);
cy.wait(200);

cy.findByText('Name').should('be.visible');
cy.findByText('Age').should('be.visible');
// header
cy.findByText('Friend Name').should('not.exist');
// cell
cy.contains('Friend Name').should('be.visible');
cy.findByText('Custom original Header1').should('not.exist');
cy.findByText('Custom original Header2').should('not.exist');
cy.contains('Custom Header').should('exist');
cy.contains('Custom Cell 2').should('be.visible');

cy.contains('Custom Header 1').should('be.visible');
cy.contains('Custom Header 2').should('be.visible');
cy.contains('pop-in content').should('exist');
cy.contains('C').should('exist');
cy.findAllByTestId('popinCell').should('exist');
cy.findAllByText('PopinDisplay Modes:').as('popinHeader').should('be.exist');
//popinDisplay: Block
cy.get('@popinHeader').parent().should('have.css', 'flex-direction', 'column');

cy.viewport(600, 1024);
cy.wait(200);
cy.contains('Age').should('not.exist');
cy.contains('40').should('not.exist');
it(`pop-in columns (${dir})`, () => {
document.body.style.margin = '0px';
cy.mount(<AnalyticalTable data={data} columns={columnsWithPopIn} dir={dir} />);
cy.viewport(801, 1024);
cy.findByText('Name').should('be.visible');
cy.findByText('Age').should('be.visible');
cy.findByText('Friend Name').should('be.visible');
cy.findByText('Custom original Header1').should('be.visible');
cy.findByText('Custom original Header2').should('be.visible');
cy.findByText('Custom Header').should('be.visible');
cy.findByText('Custom Header').should('be.visible');
cy.findByText('PopinDisplay Modes').should('be.visible').should('have.attr', 'ui5-text');
cy.findAllByTestId('popinCell').should('exist');
cy.contains('Custom Cell 2').should('be.visible');

cy.contains('Custom Header 1').should('not.exist');
cy.contains('Custom Header 2').should('not.exist');
cy.contains('pop-in content').should('not.exist');

cy.viewport(800, 1024);
cy.wait(200);

cy.findByText('Name').should('be.visible');
cy.findByText('Age').should('be.visible');
// header
cy.findByText('Friend Name').should('not.exist');
// cell
cy.contains('Friend Name').should('be.visible');
cy.findByText('Custom original Header1').should('not.exist');
cy.findByText('Custom original Header2').should('not.exist');
cy.contains('Custom Header').should('exist');
cy.contains('Custom Cell 2').should('be.visible');

cy.contains('Custom Header 1').should('be.visible');
cy.contains('Custom Header 2').should('be.visible');
cy.contains('pop-in content').should('exist');
cy.contains('C').should('exist');
cy.findAllByTestId('popinCell').should('exist');
cy.findAllByText('PopinDisplay Modes:').as('popinHeader').should('be.exist');
//popinDisplay: Block
cy.get('@popinHeader').parent().should('have.css', 'flex-direction', 'column');

cy.viewport(600, 1024);
cy.wait(200);
cy.contains('Age').should('not.exist');
cy.contains('40').should('not.exist');

cy.mount(
<AnalyticalTable
data={data}
columns={[
...columnsWithPopIn.slice(0, -1),
{
id: 'popinDisplay',
Header: 'PopinDisplay Modes',
responsivePopIn: true,
responsiveMinWidth: 801,
popinDisplay: AnalyticalTablePopinDisplay.Inline,
Cell: () => {
return (
<Text data-testid="popinCell" maxLines={1}>
Popin Cell
</Text>
);
cy.mount(
<AnalyticalTable
data={data}
columns={[
...columnsWithPopIn.slice(0, -1),
{
id: 'popinDisplay',
Header: 'PopinDisplay Modes',
responsivePopIn: true,
responsiveMinWidth: 801,
popinDisplay: AnalyticalTablePopinDisplay.Inline,
Cell: () => {
return (
<Text data-testid="popinCell" maxLines={1}>
Popin Cell
</Text>
);
},
},
},
]}
dir={dir}
/>,
);
cy.findAllByText('PopinDisplay Modes:').as('popinHeader').should('be.exist');
//popinDisplay: Row
cy.get('@popinHeader').parent().should('have.css', 'flex-direction', 'row');
cy.findAllByTestId('popinCell').should('exist');
]}
dir={dir}
/>,
);
cy.findAllByText('PopinDisplay Modes:').as('popinHeader').should('be.exist');
//popinDisplay: Row
cy.get('@popinHeader').parent().should('have.css', 'flex-direction', 'row');
cy.findAllByTestId('popinCell').should('exist');

cy.mount(
<AnalyticalTable
data={data}
columns={[
...columnsWithPopIn.slice(0, -1),
{
id: 'popinDisplay',
Header: 'PopinDisplay Modes',
responsivePopIn: true,
responsiveMinWidth: 801,
popinDisplay: AnalyticalTablePopinDisplay.WithoutHeader,
Cell: () => {
return (
<Text data-testid="popinCell" maxLines={1}>
Popin Cell
</Text>
);
cy.mount(
<AnalyticalTable
data={data}
columns={[
...columnsWithPopIn.slice(0, -1),
{
id: 'popinDisplay',
Header: 'PopinDisplay Modes',
responsivePopIn: true,
responsiveMinWidth: 801,
popinDisplay: AnalyticalTablePopinDisplay.WithoutHeader,
Cell: () => {
return (
<Text data-testid="popinCell" maxLines={1}>
Popin Cell
</Text>
);
},
},
},
]}
dir={dir}
/>,
);
//popinDisplay: WithoutHeader
cy.findAllByText('PopinDisplay Modes:').should('not.exist');
cy.findAllByTestId('popinCell').should('exist');
]}
dir={dir}
/>,
);
//popinDisplay: WithoutHeader
cy.findAllByText('PopinDisplay Modes:').should('not.exist');
cy.findAllByTestId('popinCell').should('exist');
});
});
});
} else {
['ltr', 'rtl'].forEach((dir) => {
it(`pop-in columns (${dir}) - 801 x 1024`, { viewportWidth: 801, viewportHeight: 1024 }, () => {
document.body.style.margin = '0px';
cy.mount(<AnalyticalTable data={data} columns={columnsWithPopIn} dir={dir} />);
cy.findByText('Name').should('be.visible');
cy.findByText('Age').should('be.visible');
cy.findByText('Friend Name').should('be.visible');
cy.findByText('Custom original Header1').should('be.visible');
cy.findByText('Custom original Header2').should('be.visible');
cy.findByText('Custom Header').should('be.visible');
cy.findByText('Custom Header').should('be.visible');
cy.findByText('PopinDisplay Modes').should('be.visible').should('have.attr', 'ui5-text');
cy.findAllByTestId('popinCell').should('exist');
cy.contains('Custom Cell 2').should('be.visible');

cy.contains('Custom Header 1').should('not.exist');
cy.contains('Custom Header 2').should('not.exist');
cy.contains('pop-in content').should('not.exist');
});
it(`pop-in columns (${dir}) - 800 x 1024`, { viewportWidth: 800, viewportHeight: 1024 }, () => {
cy.mount(<AnalyticalTable data={data} columns={columnsWithPopIn} dir={dir} />);
cy.findByText('Name').should('be.visible');
cy.findByText('Age').should('be.visible');
// header
cy.findByText('Friend Name').should('not.exist');
// cell
cy.contains('Friend Name').should('be.visible');
cy.findByText('Custom original Header1').should('not.exist');
cy.findByText('Custom original Header2').should('not.exist');
cy.contains('Custom Header').should('exist');
cy.contains('Custom Cell 2').should('be.visible');

cy.contains('Custom Header 1').should('be.visible');
cy.contains('Custom Header 2').should('be.visible');
cy.contains('pop-in content').should('exist');
cy.contains('C').should('exist');
cy.findAllByTestId('popinCell').should('exist');
cy.findAllByText('PopinDisplay Modes:').as('popinHeader').should('be.exist');
//popinDisplay: Block
cy.get('@popinHeader').parent().should('have.css', 'flex-direction', 'column');
});
it(`pop-in columns (${dir}) - 600 x 1024`, { viewportWidth: 600, viewportHeight: 1024 }, () => {
cy.mount(<AnalyticalTable data={data} columns={columnsWithPopIn} dir={dir} />);
cy.contains('Age').should('not.exist');
cy.contains('40').should('not.exist');

cy.mount(
<AnalyticalTable
data={data}
columns={[
...columnsWithPopIn.slice(0, -1),
{
id: 'popinDisplay',
Header: 'PopinDisplay Modes',
responsivePopIn: true,
responsiveMinWidth: 801,
popinDisplay: AnalyticalTablePopinDisplay.Inline,
Cell: () => {
return (
<Text data-testid="popinCell" maxLines={1}>
Popin Cell
</Text>
);
},
},
]}
dir={dir}
/>,
);
cy.findAllByText('PopinDisplay Modes:').as('popinHeader').should('be.exist');
//popinDisplay: Row
cy.get('@popinHeader').parent().should('have.css', 'flex-direction', 'row');
cy.findAllByTestId('popinCell').should('exist');

cy.mount(
<AnalyticalTable
data={data}
columns={[
...columnsWithPopIn.slice(0, -1),
{
id: 'popinDisplay',
Header: 'PopinDisplay Modes',
responsivePopIn: true,
responsiveMinWidth: 801,
popinDisplay: AnalyticalTablePopinDisplay.WithoutHeader,
Cell: () => {
return (
<Text data-testid="popinCell" maxLines={1}>
Popin Cell
</Text>
);
},
},
]}
dir={dir}
/>,
);
//popinDisplay: WithoutHeader
cy.findAllByText('PopinDisplay Modes:').should('not.exist');
cy.findAllByTestId('popinCell').should('exist');
});
});
}

it('pop-in columns: adjustTableHeightOnPopIn ', () => {
document.body.style.margin = '0px';
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/components/AnalyticalTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
</VirtualTableBodyContainer>
)}
</div>
{(additionalEmptyRowsCount || tableState.isScrollable === undefined || tableState.isScrollable) && (
{(additionalEmptyRowsCount || tableState.isScrollable) && (
<VerticalScrollbar
tableBodyHeight={tableBodyHeight}
internalRowHeight={internalHeaderRowHeight}
Expand Down
Loading