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

Commit 93cd432

Browse files
committed
fixing Percy datepicker example
1 parent 64ab627 commit 93cd432

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

examples/visual-testing-with-percy/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"description": "Visual diffing for component testing",
44
"private": true,
55
"scripts": {
6-
"test": "cypress-expect run --passing 2",
6+
"test": "cypress-expect run --passing 3",
77
"cy:open": "cypress open"
88
},
99
"devDependencies": {
10-
"@date-io/date-fns": "2.10.6",
10+
"@date-io/date-fns": "1",
1111
"@material-ui/core": "4.9.5",
1212
"@material-ui/pickers": "3.2.10",
1313
"@percy/cypress": "2.3.2",
Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
/// <reference types="cypress" />
22
import React from 'react'
33
import { mount } from 'cypress-react-unit-test'
4-
// import MaterialUIPickers from './DatePicker'
4+
import MaterialUIPickers from './DatePicker'
55

66
describe('Material UI date picker', () => {
77
it('sanity', () => {
88
expect(mount).to.be.a('function')
99
})
1010

11-
// https://github.com/bahmutov/cypress-react-unit-test/issues/507
12-
// SKIP https://github.com/bahmutov/cypress-react-unit-test/pull/506#issuecomment-714124015
13-
// it.skip('works', () => {
14-
// mount(<MaterialUIPickers />)
15-
// // confirm the DOM has rendered the widget
16-
// cy.get('#date-picker-inline').should('have.value', '08/18/2014')
17-
// // then take visual snapshot
18-
// cy.percySnapshot('Datepicker initial')
11+
it('works', () => {
12+
mount(<MaterialUIPickers />)
13+
// confirm the DOM has rendered the widget
14+
cy.get('#date-picker-inline').should('have.value', '08/18/2014')
15+
// then take visual snapshot
16+
cy.percySnapshot('Datepicker initial')
1917

20-
// cy.get('button[aria-label="change date"]').click()
21-
// // confirm the DOM has rendered the widget
22-
// cy.get('.MuiPickersBasePicker-container').should('be.visible')
23-
// // then take visual snapshot
24-
// cy.percySnapshot('Datepicker opened')
25-
// })
18+
cy.get('button[aria-label="change date"]').click()
19+
// confirm the DOM has rendered the widget
20+
cy.get('.MuiPickersBasePicker-container').should('be.visible')
21+
// then take visual snapshot
22+
cy.percySnapshot('Datepicker opened')
23+
})
2624
})

0 commit comments

Comments
 (0)