Browse Source

fix failing test

Olivier Massot 4 years ago
parent
commit
a8bf5e2354

+ 1 - 1
test/cypress/integration/structures/_id.spec.js

@@ -1,5 +1,5 @@
 
-describe('Test the /structures page', () => {
+describe('Test the /structures/{id} page', () => {
   beforeEach(() => {
     cy.visit('/structures/498')
   })

+ 2 - 2
test/cypress/integration/structures/index.spec.js

@@ -70,7 +70,7 @@ describe('Test the /structures page', () => {
     // 8 pages are displayed in the pagination bar (max authorized)
     cy.get('.v-pagination')
       .find('button')
-      .filter((_, elt) => { return /\d+/.match(elt.innerText) })
+      .filter((_, elt) => { return elt && elt.innerText.match(/\d+/) })
       .should('have.length.gte', 2)
 
     cy.getByLabel('input', 'Quoi ?').type('some long text that will hopefully match no result')
@@ -78,7 +78,7 @@ describe('Test the /structures page', () => {
 
     cy.get('.v-pagination')
       .find('button')
-      .filter((_, elt) => { return /\d+/.match(elt.innerText) })
+      .filter((_, elt) => { return elt && elt.innerText.match(/\d+/) })
       .should('have.length', 1)
   })