Skip to content

Commit

Permalink
feat: try without request like in gn-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Jun 6, 2024
1 parent 7c84ad1 commit c3dfaf0
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions apps/datahub-e2e/src/e2e/search.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,11 @@ describe('search', () => {
cy.login()
cy.clearFavorites()
cy.visit('/search')
cy.intercept('PUT', '**/geonetwork/srv/api/userselections/**').as(
'addFavoriteRequest'
)
cy.get('mel-datahub-results-card-search')
.eq(1)
.find('mel-datahub-heart-toggle')
.first()
.click()
cy.wait('@addFavoriteRequest').its('response.statusCode').should('eq', 201)
cy.get('mel-datahub-results-card-favorite').as('favoriteCard')
})

Expand All @@ -111,9 +107,7 @@ describe('search', () => {
.should('have.text', ' Jeux de données suivis ')
})
it('should display record results in favorite cards inside a carousel', () => {
cy.get('mel-datahub-custom-carousel')
.find('mel-datahub-results-card-favorite')
.first()
cy.get('@favoriteCard')
.find('h1')
.should(
'have.text',
Expand All @@ -132,9 +126,6 @@ describe('search', () => {
})

describe('interactions with dataset', () => {
beforeEach(() => {
cy.get('mel-datahub-results-card-favorite').first().as('firstResult')
})
it('should open the dataset page in the same application on click', () => {
cy.get('@firstResult').find('h1').click()
cy.url().should('include', 'dataset')
Expand Down

0 comments on commit c3dfaf0

Please sign in to comment.