Skip to content

Commit 7511b9f

Browse files
committed
fix test
1 parent 2894d44 commit 7511b9f

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,22 @@ yarn install
113113
yarn start
114114
```
115115

116+
### Testing
117+
118+
#### Debug Cypress
119+
120+
Starts cypress in `--headed` and `--no-exit`
121+
122+
```
123+
test:cypress:debug
124+
```
125+
126+
Test and debug single cypress file:
127+
128+
```
129+
yarn test:cypress:debug --spec "cypress/integration/close.js"
130+
```
131+
116132
### Release
117133

118134
```

cypress/integration/close.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe('close ReactDialog', () => {
110110
})
111111
})
112112

113-
it('does not close when set user clicks within the inner dialog content', () => {
113+
it('does not close when set user clicks the dialog content', () => {
114114

115115
cy.visit('cypress/test.html').then((contentWindow) => {
116116
cy.document().then((document) => {
@@ -123,7 +123,7 @@ describe('close ReactDialog', () => {
123123
React.createElement(
124124
'div',
125125
{
126-
className: 'ReactDialogInner',
126+
className: 'ReactDialogContent',
127127
style: {
128128
position: 'relative'
129129
}
@@ -140,7 +140,7 @@ describe('close ReactDialog', () => {
140140
cy.get('h1').should('exist');
141141
cy.get('.ReactDialog.ReactDialogOpen').should('exist');
142142

143-
cy.get('.ReactDialogCell .ReactDialogInner').trigger('click');
143+
cy.get('.ReactDialogContent').trigger('click');
144144

145145
cy.get('h1').should('exist');
146146
cy.get('.ReactDialog.ReactDialogOpen').should('exist');

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"prepublishOnly": "yarn build",
1616
"dev": "rollup -c rollup.dev.config.js -w",
1717
"test:integration": "yarn cypress run",
18+
"test:cypress:debug": "yarn cypress run --headed --no-exit",
1819
"test": "yarn test:integration"
1920
},
2021
"repository": "git@github.com:DePayFi/react-dialog.git",

0 commit comments

Comments
 (0)