generated from posva/vite-tailwind-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
905 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
describe('Basic tests', () => { | ||
beforeEach(() => { | ||
cy.intercept('GET', 'http://127.0.0.1:8000/api/v1/prices?page=1&size=1&order_by=-created*', { fixture: 'prices.json' }) | ||
cy.intercept('GET', 'http://127.0.0.1:8000/api/v1/prices?page=1&size=10&order_by=-date&product_code=3011360030498', { fixture: 'prices_3011360030498.json' }) | ||
cy.intercept('GET', 'http://127.0.0.1:8000/api/v1/prices?page=1&size=10&order_by=-date&category_tag=en%3Apitted-apricot', { fixture: 'prices_pitted_apricot.json' }) | ||
cy.intercept('GET', 'http://127.0.0.1:8000/api/v1/products/code/3011360030498', { fixture: 'product_3011360030498.json' }) | ||
}) | ||
|
||
it('loads the home page', () => { | ||
cy.visit('/') | ||
cy.contains('Welcome to Open Prices!') // en by default | ||
cy.get('#price-count').contains('42') | ||
}) | ||
|
||
it('displays a product page', () => { | ||
cy.visit('/products/3011360030498') | ||
cy.contains('Welcome to Open Prices!').should('not.exist') | ||
cy.get('#product-title').contains('Mayonnaise Classique') | ||
cy.get('#price-count').contains('1') | ||
cy.contains('Unknown product').should('not.exist') | ||
}) | ||
|
||
it('displays a raw product page', () => { | ||
cy.visit('/products/en:pitted-apricot') | ||
cy.contains('Welcome to Open Prices!').should('not.exist') | ||
cy.get('.v-card-title').contains('Pitted apricot') | ||
// cy.get('#price-count').contains('1') | ||
cy.contains('Unknown product') // to fix | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
Oops, something went wrong.