diff --git a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts index 24359c624..9e1862914 100644 --- a/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts @@ -313,11 +313,33 @@ describe('dashboard (authenticated)', () => { }) }) }) - describe('search filters', () => { + describe.only('search filters', () => { + function checkFilterByChangeDate() { + cy.get('mat-calendar-header').find('button').first().click() + cy.get('mat-multi-year-view').contains('button', '2024').click() + cy.get('mat-year-view').contains('button', 'AUG').click() + cy.get('mat-month-view').contains('button', '1').click() + cy.get('mat-month-view').contains('button', '30').click() + cy.get('gn-ui-interactive-table') + .find('[data-cy="table-row"]') + .should('have.length', '1') + cy.get('gn-ui-results-table') + .find('[data-cy="resultItemTitle"]') + .each(($resultItemTitle) => { + cy.wrap($resultItemTitle) + .invoke('text') + .should('eq', 'Accroches vélos MEL') + }) + } describe('allRecords search filter', () => { beforeEach(() => { cy.visit('/catalog/search') }) + it('should contain filter component with one search filter', () => { + cy.get('md-editor-search-filters') + .find('gn-ui-button') + .should('have.length', 2) + }) it('should filter the record list by editor (Barbara Roberts)', () => { cy.get('md-editor-search-filters').find('gn-ui-button').first().click() cy.get('.cdk-overlay-container') @@ -333,15 +355,23 @@ describe('dashboard (authenticated)', () => { cy.wrap($ownerInfo).invoke('text').should('eq', 'Barbara Roberts') }) }) + it('should filter the record list by last update (changeDate)', () => { + cy.get('md-editor-search-filters').find('gn-ui-button').eq(1).click() + checkFilterByChangeDate() + }) }) describe('myRecords search filters', () => { beforeEach(() => { cy.visit('/my-space/my-records') }) - it('should contain filter component with no search filter for now', () => { + it('should contain filter component with one search filter', () => { cy.get('md-editor-search-filters') .find('gn-ui-button') - .should('not.exist') + .should('have.length', 1) + }) + it('should filter the record list by last update (changeDate)', () => { + cy.get('md-editor-search-filters').find('gn-ui-button').first().click() + checkFilterByChangeDate() }) }) }) diff --git a/libs/ui/search/src/lib/results-table/results-table.component.html b/libs/ui/search/src/lib/results-table/results-table.component.html index fe2c86a8a..8df640f4a 100644 --- a/libs/ui/search/src/lib/results-table/results-table.component.html +++ b/libs/ui/search/src/lib/results-table/results-table.component.html @@ -36,7 +36,9 @@
- {{ item.title }} + {{ + item.title + }}