-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
b22bd1d
commit 111d70b
Showing
11 changed files
with
82 additions
and
93 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
cypress/integration/auth.spec.js → cypress/integration/auth.spec.ts
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/// <reference types="Cypress" /> | ||
|
||
import * as faker from 'faker'; | ||
|
||
describe(`auth`, () => { | ||
|
2 changes: 0 additions & 2 deletions
2
cypress/integration/canary.spec.js → cypress/integration/canary.spec.ts
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
/// <reference types="Cypress" /> | ||
|
||
describe(`canary`, () => { | ||
it(`able to load`, () => { | ||
cy.visit('/'); | ||
|
6 changes: 2 additions & 4 deletions
6
cypress/integration/career.spec.js → cypress/integration/career.spec.ts
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
3 changes: 0 additions & 3 deletions
3
cypress/integration/chat.spec.js → cypress/integration/chat.spec.ts
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
3 changes: 0 additions & 3 deletions
3
cypress/integration/support.spec.js → cypress/integration/support.spec.ts
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,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"baseUrl": "../node_modules", | ||
"target": "es5", | ||
"lib": ["es5", "dom"], | ||
"types": [ | ||
"cypress", | ||
"@types/testing-library__cypress", | ||
"cypress-file-upload" | ||
] | ||
}, | ||
"include": ["**/*.ts"] | ||
} |
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 was deleted.
Oops, something went wrong.
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,31 @@ | ||
import { screen, wait } from '@testing-library/react'; | ||
import * as React from 'react'; | ||
import { renderWithStateMgmtAndRouter, user } from '../lib/test-util'; | ||
import { ProductPage } from './product-page'; | ||
|
||
jest.mock('../modules/products/product.service'); | ||
|
||
describe('<ProductPage />', () => { | ||
it('allows customer to add product to cart', async () => { | ||
renderWithStateMgmtAndRouter(<ProductPage productId="1" />); | ||
|
||
const addToCartBtn = await screen.findByText('Add To Cart'); | ||
|
||
user.click(addToCartBtn); | ||
|
||
await wait(); // to suppress act() warning | ||
}); | ||
|
||
it('allows customer to add comment', async () => { | ||
renderWithStateMgmtAndRouter(<ProductPage productId="1" />); | ||
|
||
await screen.findByLabelText('Your Name'); | ||
|
||
await user.type(screen.getByLabelText('Your Name'), 'Malcolm Kee'); | ||
await user.type(screen.getByLabelText('Your Review'), 'I like it.'); | ||
|
||
user.click(screen.getByTestId('product-comment-submit-btn')); | ||
|
||
await wait(); // to suppress act() warning | ||
}); | ||
}); |