diff --git a/examples/visual-testing-with-percy/package.json b/examples/visual-testing-with-percy/package.json index 5a478b60..5bc26239 100644 --- a/examples/visual-testing-with-percy/package.json +++ b/examples/visual-testing-with-percy/package.json @@ -3,11 +3,11 @@ "description": "Visual diffing for component testing", "private": true, "scripts": { - "test": "cypress-expect run --passing 2", + "test": "cypress-expect run --passing 3", "cy:open": "cypress open" }, "devDependencies": { - "@date-io/date-fns": "2.10.6", + "@date-io/date-fns": "1", "@material-ui/core": "4.9.5", "@material-ui/pickers": "3.2.10", "@percy/cypress": "2.3.2", diff --git a/examples/visual-testing-with-percy/src/DatePicker.cy-spec.js b/examples/visual-testing-with-percy/src/DatePicker.cy-spec.js index 9342893a..9c3a17d2 100644 --- a/examples/visual-testing-with-percy/src/DatePicker.cy-spec.js +++ b/examples/visual-testing-with-percy/src/DatePicker.cy-spec.js @@ -1,26 +1,24 @@ /// import React from 'react' import { mount } from 'cypress-react-unit-test' -// import MaterialUIPickers from './DatePicker' +import MaterialUIPickers from './DatePicker' describe('Material UI date picker', () => { it('sanity', () => { expect(mount).to.be.a('function') }) - // https://github.com/bahmutov/cypress-react-unit-test/issues/507 - // SKIP https://github.com/bahmutov/cypress-react-unit-test/pull/506#issuecomment-714124015 - // it.skip('works', () => { - // mount() - // // confirm the DOM has rendered the widget - // cy.get('#date-picker-inline').should('have.value', '08/18/2014') - // // then take visual snapshot - // cy.percySnapshot('Datepicker initial') + it('works', () => { + mount() + // confirm the DOM has rendered the widget + cy.get('#date-picker-inline').should('have.value', '08/18/2014') + // then take visual snapshot + cy.percySnapshot('Datepicker initial') - // cy.get('button[aria-label="change date"]').click() - // // confirm the DOM has rendered the widget - // cy.get('.MuiPickersBasePicker-container').should('be.visible') - // // then take visual snapshot - // cy.percySnapshot('Datepicker opened') - // }) + cy.get('button[aria-label="change date"]').click() + // confirm the DOM has rendered the widget + cy.get('.MuiPickersBasePicker-container').should('be.visible') + // then take visual snapshot + cy.percySnapshot('Datepicker opened') + }) })