mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 12:24:18 +00:00
.github
.vscode
ISSUE_TEMPLATE
cypress
config
fixtures
integration
header.spec.js
home.spec.js
plugins
support
packages
site
.editorconfig
.gitignore
.prettierignore
.prettierrc
README.md
cypress.json
license.md
package.json
renovate.json
turbo.json
yarn.lock
33 lines
935 B
JavaScript
33 lines
935 B
JavaScript
describe('Header', () => {
|
|
beforeEach(() => cy.visit('/'))
|
|
|
|
it('links to the correct pages', () => {
|
|
cy.getBySel('logo').click()
|
|
cy.location('pathname').should('eq', '/')
|
|
|
|
cy.getBySel('nav-link-search').click()
|
|
cy.location('pathname').should('eq', '/search')
|
|
|
|
cy.getBySelLike('nav-link-home-page-Home').click()
|
|
cy.location('pathname').should('eq', '/search/frontpage')
|
|
})
|
|
|
|
it('the search bar returns the correct search results', () => {
|
|
cy.getBySel('search-input').eq(0).type('tshirt-stack-overflow{enter}')
|
|
|
|
cy.getBySel('product-card')
|
|
.should('be.visible')
|
|
.within(() => {
|
|
cy.getBySel('product-name').should('contain', 'tshirt-stack-overflow')
|
|
cy.getBySel('product-price').should('contain', '$25.00 USD')
|
|
})
|
|
})
|
|
})
|
|
|
|
describe('Shopping Cart', () => {
|
|
it('users can add products to the cart', () => {
|
|
cy.visit('/')
|
|
cy.getBySel('product-tag')
|
|
})
|
|
})
|