Skip to content

Commit 1b6c04d

Browse files
Merge pull request #1590 from ral-facilities/spares-filter-button-bug-1588
Spares filter button (Bug) #1588
2 parents 3afc4b9 + 45e085a commit 1b6c04d

File tree

5 files changed

+315
-163
lines changed

5 files changed

+315
-163
lines changed

cypress/e2e/with_mock_data/items.cy.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,39 @@ describe('Items', () => {
518518
cy.findByText('WrgqAVk3qUQK').should('exist');
519519
});
520520

521+
it('set spares definition filter and checks the banner is still visible when grouped and then and clears the table filters', () => {
522+
cy.visit('/catalogue/9/items/11/items');
523+
cy.findByText('dfzqkOJbqifO').should('exist');
524+
cy.findByText('tenrMn1KOmIg').should('exist');
525+
cy.findByText('eUc80U7FqJum').should('exist');
526+
cy.findByText('WrgqAVk3qUQK').should('exist');
527+
cy.findByRole('button', { name: 'Show Spare Items' }).should(
528+
'not.be.disabled'
529+
);
530+
cy.findByRole('button', { name: 'Show Spare Items' }).click();
531+
cy.findByText('dfzqkOJbqifO').should('exist');
532+
cy.findByText('tenrMn1KOmIg').should('not.exist');
533+
cy.findByText('eUc80U7FqJum').should('not.exist');
534+
cy.findByText('WrgqAVk3qUQK').should('not.exist');
535+
cy.findByRole('button', { name: 'Show Spare Items' }).should('be.disabled');
536+
537+
cy.findByText('Spares Definition Filter Applied').should('exist');
538+
cy.findByLabelText(
539+
'Items that are contained within the system type Storage are classified as spares'
540+
).should('exist');
541+
542+
cy.findAllByRole('button', { name: 'Column Actions' }).eq(3).click();
543+
cy.findByText('Group by Asset Number').click();
544+
545+
cy.findByText('Spares Definition Filter Applied').should('exist');
546+
cy.findByLabelText(
547+
'Items that are contained within the system type Storage are classified as spares'
548+
).should('exist');
549+
550+
cy.findByRole('button', { name: 'Clear Filters' }).click();
551+
cy.findByText('DEAbxBGr2M', { exact: false }).should('exist');
552+
});
553+
521554
it('navigates to the landing page and navigates back to the table view', () => {
522555
cy.findByText('5YUQDDjKpz2z').click();
523556
cy.findByText(

0 commit comments

Comments
 (0)