Skip to content

Commit

Permalink
updates sourcing-locations table test
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgnlez committed May 6, 2024
1 parent 526c644 commit 2d9e1db
Show file tree
Hide file tree
Showing 2 changed files with 1,113 additions and 31 deletions.
12 changes: 9 additions & 3 deletions client/cypress/e2e/data/table.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
describe('Data ingestion: table visualization', () => {
beforeEach(() => {
cy.intercept('GET', '/api/v1/sourcing-locations/materials*').as('sourcingLocationsMaterials');
cy.intercept('GET', '/api/v1/sourcing-locations/materials*', {
fixture: 'sourcing-locations/materials',
}).as('sourcingLocationsMaterials');
cy.login();
cy.visit('/data');
});
Expand All @@ -12,8 +14,12 @@ describe('Data ingestion: table visualization', () => {
it('see data ingested in a table', () => {
cy.wait('@sourcingLocationsMaterials').then((interception) => {
cy.get('table').should('be.visible');
// based on data and pagination, there should be more than 50 rows in the table
cy.get('tr.group').should('have.length', interception.response.body?.meta.size);
const { meta } = interception.response?.body || {};

cy.get('tr.group').should(
'have.length',
meta?.size > meta?.totalItems ? meta?.totalItems : meta?.size,
);
});
});

Expand Down
Loading

0 comments on commit 2d9e1db

Please sign in to comment.