Skip to content

Commit

Permalink
Adding some navigation e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviemirmon committed May 24, 2021
1 parent 67d1725 commit 5f05c57
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cypress/e2e/navigation.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference types="Cypress" />

describe("Navigation tests", () => {
it("Has search bar", () => {
cy.visit("/").get('input:first').should('have.attr', 'placeholder', 'Enter search text...')
})
it("Adds text to search bar (no results)", () => {
cy.visit("/").get('input').type('Hello, World')
cy.get('[data-testid="SearchList"] span').should('include.text', 'Hello, World').should('include.text', 'Oops')
})
it("Adds text to search bar (Pikachu)", () => {
cy.visit("/").get('input').type('Pika')
cy.get('[data-testid="SearchList"] div').eq(1).get('a span').should('include.text', 'Pikachu').should('include.text', '025')
})
})

0 comments on commit 5f05c57

Please sign in to comment.