Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Commit 41eefdd

Browse files
authored
example visual change (#195)
1 parent 1f3b024 commit 41eefdd

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ If you are using [plugins/cra-v3](plugins/cra-v3) it instruments the code on the
235235

236236
## Visual testing
237237

238-
You can use any [Visual Testing plugin](https://on.cypress.io/plugins#visual-testing) from these component tests. This repo uses [Percy.io](https://percy.io) visual diffing service as a GitHub pull request check.
238+
You can use any Cypress [Visual Testing plugin](https://on.cypress.io/plugins#visual-testing) to perform [visual testing](https://on.cypress.io/visual-testing) from the component tests. This repo uses [Percy.io](https://percy.io) visual diffing service as a GitHub pull request check, see [visual-testing](examples/visual-testing) example.
239239

240240
## Common problems
241241

examples/visual-testing/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@ cy.percySnapshot('Datepicker opened')
2424

2525
### Visual change
2626

27+
If a pull request introduces visual changes, they are caught and shown as a diff
28+
29+
![Visual change](images/diff.gif)
30+
2731
**Tip:** you can use any [visual testing](https://on.cypress.io/visual-testing) plugin with component testing.
300 KB
Loading

examples/visual-testing/src/DatePicker.cy-spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('Material UI date picker', () => {
66
it('works', () => {
77
mount(<MaterialUIPickers />)
88
// confirm the DOM has rendered the widget
9-
cy.get('#date-picker-inline').should('have.value', '08/10/2014')
9+
cy.get('#date-picker-inline').should('have.value', '08/18/2014')
1010
// then take visual snapshot
1111
cy.percySnapshot('Datepicker initial')
1212

examples/visual-testing/src/DatePicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
export default function MaterialUIPickers() {
1111
// The first commit of Material-UI
1212
const [selectedDate, setSelectedDate] = React.useState(
13-
new Date('2014-08-10T21:11:54'),
13+
new Date('2014-08-18T21:11:54'),
1414
)
1515

1616
const handleDateChange = date => {

0 commit comments

Comments
 (0)