Skip to content

Commit

Permalink
e2e: simplify orgs tests & adapt headers test
Browse files Browse the repository at this point in the history
The sort by combos have been slightly changed to avoid using JSON as values.
This was breaking the e2e tests and doing a join(',') is also much simpler.

The values for the orgs filter dropdown have been updated to show correct
values.

also fixed a bug when clicking on the org name in the dataset view
  • Loading branch information
jahow committed Aug 25, 2023
1 parent ade09fb commit 6d70763
Show file tree
Hide file tree
Showing 14 changed files with 188 additions and 301 deletions.
6 changes: 3 additions & 3 deletions apps/datahub-e2e/src/e2e/datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ describe('datasets', () => {
expect(dropdownOptions).to.eql([
'Agence wallonne du Patrimoine (SPW - Territoire, Logement, Patrimoine, Énergie - Agence wallonne du Patrimoine) (1)',
'atmo Hauts-de-France (1)',
'Bundesamt für Raumentwicklung (2)',
'Bundesamt für Raumentwicklung (1)',
"Canton du Valais - Service de l'environnement (SEN) - Protection des sols (1)",
'Cellule informatique et géomatique (SPW - Intérieur et Action sociale - Direction fonctionnelle et d’appui) (1)',
"Direction de l'Action sociale (SPW - Intérieur et Action sociale - Département de l'Action sociale - Direction de l'Action sociale) (1)",
'DREAL (1)',
"DREAL HdF (Direction Régionale de l'Environnement de l'Aménagement et du Logement des Hauts de France) (54)",
"DREAL HdF (Direction Régionale de l'Environnement de l'Aménagement et du Logement des Hauts de France) (1)",
'Géo2France (1)',
"Helpdesk carto du SPW (SPW - Secrétariat général - SPW Digital - Département de la Géomatique - Direction de l'Intégration des géodonnées) (2)",
'Métropole Européenne de Lille (1)',
'Région Hauts-de-France (2)',
'Service public de Wallonie (SPW) (2)',
"Société Publique de Gestion de l'Eau (SPGE) (2)",
"Société Publique de Gestion de l'Eau (SPGE) (1)",
])
})
})
Expand Down
20 changes: 10 additions & 10 deletions apps/datahub-e2e/src/e2e/header.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,34 +97,34 @@ describe('header', () => {
})
})

describe('filter search actions', () => {
describe('filter and sort', () => {
beforeEach(() => {
cy.visit('/search')
cy.get('gn-ui-record-preview-row').as('initialList')
cy.visit('/news')
})

it('should create two filter buttons upon loading page', () => {
cy.get('gn-ui-fuzzy-search')
.next()
.find('button')
.should('have.length', 2)
})

beforeEach(() => {
cy.visit('/search')
cy.get('gn-ui-record-preview-row').as('initialList')
cy.visit('/news')
})

it('should filter results by latest date', () => {
it('should sort results by latest date', () => {
cy.get('gn-ui-fuzzy-search').next().find('button').first().click()
cy.get('gn-ui-record-preview-row').should('not.eq', '@initialList')
cy.get('select#sort-by- option:selected').should(
'have.value',
'-createDate'
'desc,createDate'
)
})
it('should filter results by popularity', () => {
cy.get('gn-ui-fuzzy-search').next().find('button').eq(1).click()
cy.get('gn-ui-record-preview-row').should('not.eq', '@initialList')
cy.get('select#sort-by- option:selected').should(
'have.value',
'-userSavedCount'
'desc,userSavedCount'
)
})
})
Expand Down
248 changes: 0 additions & 248 deletions apps/datahub-e2e/src/e2e/organisations.cy.ts

This file was deleted.

Loading

0 comments on commit 6d70763

Please sign in to comment.