Skip to content

Commit

Permalink
essai
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Jun 7, 2024
1 parent 1a59f4f commit a09b42e
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions apps/datahub-e2e/src/e2e/search.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,26 @@ describe('search', () => {
describe('User logged in', () => {
before(() => {
cy.login()
cy.clearFavorites()
cy.visit('/search')
cy.get('mel-datahub-results-card-search')
.eq(1)
.find('mel-datahub-heart-toggle')
.first()
.click()
cy.intercept('PUT', '**/geonetwork/srv/api/userselections/**').as(
'addFavoriteRequest'
)
if (!cy.get('mel-datahub-results-card-favorite')) {
cy.clearFavorites()
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)
}
})

describe('favorite interactions', () => {
beforeEach(() => {
cy.get('mel-datahub-results-card-favorite').as('favoriteCard')
})

it('should display the correct subtitle', () => {
cy.get('mel-datahub-search-header')
.find('.mel-section-title')
Expand All @@ -117,18 +123,18 @@ describe('search', () => {
'have.text',
' Metadata for E2E testing purpose. (this title is too long and should be cut, this title is too long and should be cut, this title is too long and should be cut, this title is too long and should be cut, this title is too long and should be cut) '
)

cy.get('.mel-carousel-step-dot').should('not.exist')

cy.get('@favoriteCard')
.find('.mel-badge-button-primary')
.should('be.visible')

cy.get('@favoriteCard')
.find('mel-datahub-metadata-quality')
.should('be.visible')
})

describe('interactions with dataset', () => {
it('should open the dataset page in the same application on click', () => {
cy.get('@firstResult').find('h1').click()
Expand Down

0 comments on commit a09b42e

Please sign in to comment.