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

Commit 64ab627

Browse files
authored
Move dependencies for visual projects (#506)
1 parent de3b9b8 commit 64ab627

File tree

7 files changed

+344
-4009
lines changed

7 files changed

+344
-4009
lines changed

circle.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,14 @@ workflows:
376376
executor: cypress/base-12
377377
requires:
378378
- Component Tests
379-
# each example installs "cypress-react-unit-test" as a local dependency (symlink)
380-
install-command: npm install --no-bin-links
379+
install-command: |
380+
ls -la ../..
381+
echo ***Installing cypress-react-unit-test from root TGZ archive***
382+
npm install -D ../../cypress-react-unit-test-0.0.0-development.tgz
383+
echo ***Installing other dependencies***
384+
npm install
385+
echo ***rename root node_modules to avoid accidental dependencies***
386+
mv ../../node_modules ../../no_modules
381387
verify-command: echo 'Already verified'
382388
no-workspace: true
383389
working_directory: examples/visual-testing-with-applitools
@@ -398,8 +404,14 @@ workflows:
398404
executor: cypress/base-12
399405
requires:
400406
- Component Tests
401-
# each example installs "cypress-react-unit-test" as a local dependency (symlink)
402-
install-command: npm install --no-bin-links
407+
install-command: |
408+
ls -la ../..
409+
echo ***Installing cypress-react-unit-test from root TGZ archive***
410+
npm install -D ../../cypress-react-unit-test-0.0.0-development.tgz
411+
echo ***Installing other dependencies***
412+
npm install
413+
echo ***rename root node_modules to avoid accidental dependencies***
414+
mv ../../node_modules ../../no_modules
403415
verify-command: echo 'Already verified'
404416
no-workspace: true
405417
working_directory: examples/visual-testing-with-percy
@@ -413,8 +425,14 @@ workflows:
413425
executor: cypress/base-12
414426
requires:
415427
- Component Tests
416-
# each example installs "cypress-react-unit-test" as a local dependency (symlink)
417-
install-command: npm install --no-bin-links
428+
install-command: |
429+
ls -la ../..
430+
echo ***Installing cypress-react-unit-test from root TGZ archive***
431+
npm install -D ../../cypress-react-unit-test-0.0.0-development.tgz
432+
echo ***Installing other dependencies***
433+
npm install
434+
echo ***rename root node_modules to avoid accidental dependencies***
435+
mv ../../node_modules ../../no_modules
418436
verify-command: echo 'Already verified'
419437
no-workspace: true
420438
working_directory: examples/visual-testing-with-happo

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
"description": "Visual diffing for component testing using Applittols",
44
"private": true,
55
"scripts": {
6-
"test": "../../node_modules/.bin/cypress run",
7-
"cy:open": "../../node_modules/.bin/cypress open"
6+
"test": "cypress-expect run --passing 2",
7+
"cy:open": "cypress open"
88
},
99
"devDependencies": {
10-
"cypress-react-unit-test": "file:../.."
10+
"@applitools/eyes-cypress": "3.15.2",
11+
"cypress-expect": "2.1.2",
12+
"cypress-react-unit-test": "file:../..",
13+
"cypress": "5.3.0",
14+
"react-dom": "^16.13.1",
15+
"react-scripts": "3.4.1",
16+
"react": "^16.13.1",
17+
"victory": "34.3.6"
1118
}
1219
}

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@
33
"description": "Visual component testing using Happo.io",
44
"private": true,
55
"scripts": {
6-
"test": "../../node_modules/.bin/cypress run",
7-
"cy:open": "../../node_modules/.bin/cypress open",
8-
"test:happo": "../../node_modules/.bin/happo-cypress -- npm test"
6+
"test": "cypress-expect run --passing 3",
7+
"cy:open": "cypress open",
8+
"test:happo": "happo-cypress -- npm test"
99
},
1010
"devDependencies": {
11-
"cypress-react-unit-test": "file:../.."
11+
"cypress-expect": "2.1.2",
12+
"cypress-react-unit-test": "file:../..",
13+
"cypress": "5.3.0",
14+
"react-dom": "^16.13.1",
15+
"react-scripts": "3.4.1",
16+
"react": "^16.13.1",
17+
"happo-cypress": "1.9.2",
18+
"happo.io": "5.6.1",
19+
"react-calendar-heatmap": "1.8.1",
20+
"react-tooltip": "4.2.6"
1221
}
1322
}

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@
33
"description": "Visual diffing for component testing",
44
"private": true,
55
"scripts": {
6-
"test": "../../node_modules/.bin/cypress run",
7-
"cy:open": "../../node_modules/.bin/cypress open"
6+
"test": "cypress-expect run --passing 2",
7+
"cy:open": "cypress open"
88
},
99
"devDependencies": {
10-
"cypress-react-unit-test": "file:../.."
10+
"@date-io/date-fns": "2.10.6",
11+
"@material-ui/core": "4.9.5",
12+
"@material-ui/pickers": "3.2.10",
13+
"@percy/cypress": "2.3.2",
14+
"cypress": "5.3.0",
15+
"cypress-expect": "2.1.2",
16+
"cypress-react-unit-test": "file:../..",
17+
"date-fns": "2.16.1",
18+
"react": "^16.13.1",
19+
"react-dom": "^16.13.1",
20+
"react-scripts": "3.4.1"
1121
}
1222
}
Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
1+
/// <reference types="cypress" />
12
import React from 'react'
23
import { mount } from 'cypress-react-unit-test'
3-
import MaterialUIPickers from './DatePicker'
4+
// import MaterialUIPickers from './DatePicker'
45

56
describe('Material UI date picker', () => {
6-
it('works', () => {
7-
mount(<MaterialUIPickers />)
8-
// confirm the DOM has rendered the widget
9-
cy.get('#date-picker-inline').should('have.value', '08/18/2014')
10-
// then take visual snapshot
11-
cy.percySnapshot('Datepicker initial')
12-
13-
cy.get('button[aria-label="change date"]').click()
14-
// confirm the DOM has rendered the widget
15-
cy.get('.MuiPickersBasePicker-container').should('be.visible')
16-
// then take visual snapshot
17-
cy.percySnapshot('Datepicker opened')
7+
it('sanity', () => {
8+
expect(mount).to.be.a('function')
189
})
10+
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')
19+
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+
// })
1926
})

0 commit comments

Comments
 (0)