Skip to content

Commit 377a2ce

Browse files
Merge pull request #4715 from nextcloud/renovate/stable26-eslint-plugin-cypress-2.x
chore(deps): update dependency eslint-plugin-cypress to ^2.14.0 (stable26)
2 parents bcfb6dd + 4601b0e commit 377a2ce

File tree

6 files changed

+92
-55
lines changed

6 files changed

+92
-55
lines changed

cypress/e2e/MenuBar.spec.js

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,33 @@ describe('Test the rich text editor menu bar', function() {
2828
}
2929

3030
beforeEach(cy.clearContent)
31+
3132
it('empty file', () => {
3233
cy.getFile(fileName)
33-
.then($el => {
34-
cy.getActionEntry('remain')
35-
.click()
36-
getWordCount()
37-
.should('include.text', '0 words, 0 chars')
38-
})
34+
cy.getActionEntry('remain')
35+
.click()
36+
getWordCount()
37+
.should('include.text', '0 words, 0 chars')
3938
})
4039

4140
it('single word', () => {
4241
cy.getFile(fileName)
43-
.then($el => {
44-
cy.clearContent()
45-
.type(' Hello ')
46-
cy.getActionEntry('remain')
47-
.click()
48-
getWordCount()
49-
.should('include.text', '1 word, 9 chars')
50-
})
42+
cy.getContent()
43+
.type(' Hello ')
44+
cy.getActionEntry('remain')
45+
.click()
46+
getWordCount()
47+
.should('include.text', '1 word, 9 chars')
5148
})
5249

5350
it('multiple words', () => {
5451
cy.getFile(fileName)
55-
.then($el => {
56-
cy.clearContent()
57-
.type('Hello \nworld')
58-
cy.getActionEntry('remain')
59-
.click()
60-
getWordCount()
61-
.should('include.text', '2 words, 11 chars')
62-
})
52+
cy.getContent()
53+
.type('Hello \nworld')
54+
cy.getActionEntry('remain')
55+
.click()
56+
getWordCount()
57+
.should('include.text', '2 words, 11 chars')
6358
})
6459
})
6560
})

cypress/e2e/nodes/FrontMatter.spec.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,32 @@ describe('Front matter support', function() {
3333
})
3434

3535
it('Open file with front matter', function() {
36-
cy.openFile('frontmatter.md').then(() => {
37-
cy.getContent().find('pre.frontmatter').should(pre => {
38-
expect(pre.length === 1)
39-
expect(pre[0].text === 'some: value\nother: 1.2')
40-
})
36+
cy.openFile('frontmatter.md')
37+
cy.getContent().find('pre.frontmatter').should(pre => {
38+
expect(pre.length === 1)
39+
expect(pre[0].text === 'some: value\nother: 1.2')
4140
})
4241
})
4342

4443
it('Add front matter', function() {
45-
cy.openFile('empty.md').clearContent().then(() => {
46-
cy.getContent().type('---')
47-
cy.getContent().type('test')
48-
cy.getContent().find('pre.frontmatter').should(pre => {
49-
expect(pre.length === 1)
50-
expect(pre[0].text === 'test')
51-
})
44+
cy.openFile('empty.md')
45+
cy.clearContent()
46+
cy.getContent().type('---')
47+
cy.getContent().type('test')
48+
cy.getContent().find('pre.frontmatter').should(pre => {
49+
expect(pre.length === 1)
50+
expect(pre[0].text === 'test')
5251
})
5352
})
5453

5554
it('Do not add multiple front matter', function() {
56-
cy.openFile('empty.md').clearContent().then(() => {
57-
cy.getContent().type('---test')
58-
cy.getContent().type('{downArrow}')
59-
cy.getContent().type('---test')
60-
cy.getContent().find('pre.frontmatter').should(pre => expect(pre.length === 1))
61-
cy.getContent().find('hr').should(hr => expect(hr.length === 1))
62-
})
55+
cy.openFile('empty.md')
56+
cy.clearContent()
57+
cy.getContent().type('---test')
58+
cy.getContent().type('{downArrow}')
59+
cy.getContent().type('---test')
60+
cy.getContent().find('pre.frontmatter').should(pre => expect(pre.length === 1))
61+
cy.getContent().find('hr').should(hr => expect(hr.length === 1))
6362
})
6463

6564
it('Reopen front matter', function() {

cypress/e2e/nodes/Links.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ describe('test link marks', function() {
4949

5050
const link = `${Cypress.env('baseUrl')}/apps/files/file-name?fileId=${id}`
5151
cy.clearContent()
52+
cy.getContent()
5253
.type(`${link}{enter}`)
5354

5455
cy.getContent()
@@ -68,6 +69,7 @@ describe('test link marks', function() {
6869

6970
const link = `${Cypress.env('baseUrl')}/file-name?fileId=${id}`
7071
cy.clearContent()
72+
cy.getContent()
7173
.type(`${link}{enter}`)
7274

7375
cy.getContent()
@@ -82,6 +84,7 @@ describe('test link marks', function() {
8284

8385
it('without protocol', () => {
8486
cy.clearContent()
87+
cy.getContent()
8588
.type('google.com{enter}')
8689
cy.getContent()
8790
.find('a[href*="google.com"]')
@@ -118,7 +121,6 @@ describe('test link marks', function() {
118121
.should('have.been.calledWith', url)
119122
}
120123

121-
beforeEach(cy.clearContent)
122124
it('Link website without selection', () => {
123125
cy.getFile(fileName)
124126
.then($el => {
@@ -148,8 +150,6 @@ describe('test link marks', function() {
148150
.click({ force: true })
149151
}
150152

151-
beforeEach(() => cy.clearContent())
152-
153153
it('without text', () => {
154154
cy.getFile(fileName)
155155
.then($el => {

cypress/support/commands.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ Cypress.Commands.add('getTOC', () => {
375375
Cypress.Commands.add('clearContent', () => {
376376
cy.getContent().scrollIntoView()
377377
cy.getContent().type('{selectAll}{backspace}')
378-
return cy.getContent()
379378
})
380379

381380
Cypress.Commands.add('openWorkspace', () => {

package-lock.json

Lines changed: 53 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"@vue/test-utils": "^1.3.0 <2",
127127
"@vue/vue2-jest": "^29.2.5",
128128
"cypress": "^12.17.4",
129-
"eslint-plugin-cypress": "^2.13.3",
129+
"eslint-plugin-cypress": "^2.14.0",
130130
"identity-obj-proxy": "^3.0.0",
131131
"jest": "^29.6.2",
132132
"jest-environment-jsdom": "^29.6.2",

0 commit comments

Comments
 (0)