Skip to content

Commit 033860c

Browse files
committed
test: Use example.org instead of nextcloud.com for testing links
CI often runs into rate limits when testing against nextcloud.com and we're asked to not use nextcloud.com in tests anyway. Signed-off-by: Jonas <jonas@freesources.org>
1 parent 0cef695 commit 033860c

File tree

13 files changed

+68
-70
lines changed

13 files changed

+68
-70
lines changed

cypress/e2e/Links.spec.js

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,30 @@ describe('test link marks', function () {
3636
}
3737

3838
it('shows a link preview in the bubble after clicking link', () => {
39-
const link = 'https://nextcloud.com/'
39+
const link = 'https://example.org/'
4040
cy.insertLine(link)
4141
clickLink(link)
4242

4343
cy.get('.link-view-bubble .widget-default', { timeout: 10000 })
4444
.find('.widget-default--name')
45-
.contains('Nextcloud')
45+
.contains('Example Domain')
4646
.click()
4747
})
4848

4949
it('shows a link preview in the bubble after browsing to link', () => {
50-
const link = 'https://nextcloud.com/'
50+
const link = 'https://example.org/'
5151
cy.insertLine(link)
5252
cy.getContent().find(`a[href*="${link}"]`)
5353

5454
cy.getContent().type('{upArrow}')
5555

5656
cy.get('.link-view-bubble .widget-default', { timeout: 10000 })
5757
.find('.widget-default--name')
58-
.contains('Nextcloud')
58+
.contains('Example Domain')
5959
})
6060

6161
it('open button opens a new tab', () => {
62-
const link = 'https://nextcloud.com/'
62+
const link = 'https://example.org/'
6363
cy.insertLine(link)
6464
clickLink(link)
6565

@@ -69,13 +69,13 @@ describe('test link marks', function () {
6969
})
7070

7171
it('closes the link bubble when clicking elsewhere', () => {
72-
const link = 'https://nextcloud.com/'
72+
const link = 'https://example.org/'
7373
cy.insertLine(link)
7474
clickLink(link)
7575

7676
cy.get('.link-view-bubble .widget-default', { timeout: 10000 })
7777
.find('.widget-default--name')
78-
.contains('Nextcloud')
78+
.contains('Example Domain')
7979

8080
cy.get('[role="dialog"] h2.modal-header__name')
8181
.contains(fileName)
@@ -85,22 +85,20 @@ describe('test link marks', function () {
8585
})
8686

8787
it('allows to edit a link in the bubble', () => {
88-
cy.insertLine('https://example.org')
89-
clickLink('https://example.org')
88+
cy.insertLine('https://example.com')
89+
clickLink('https://example.com')
9090

9191
cy.get('.link-view-bubble button[title="Edit link"]').click()
9292

93-
cy.get('.link-view-bubble input').type(
94-
'{selectAll}https://nextcloud.com',
95-
)
93+
cy.get('.link-view-bubble input').type('{selectAll}https://example.org')
9694

9795
cy.get('.link-view-bubble button[title="Save changes"]').click()
9896

99-
cy.getContent().find('a[href*="https://nextcloud.com"]')
97+
cy.getContent().find('a[href*="https://example.org"]')
10098
})
10199

102100
it('allows to remove a link in the bubble', () => {
103-
const link = 'https://nextcloud.com'
101+
const link = 'https://example.org'
104102
cy.insertLine(link)
105103
clickLink(link)
106104

@@ -111,7 +109,7 @@ describe('test link marks', function () {
111109
})
112110

113111
it('Ctrl-click on a link opens a new tab', () => {
114-
const link = 'https://nextcloud.com/'
112+
const link = 'https://example.org/'
115113
cy.insertLine(link)
116114

117115
clickLink(link, { ctrlKey: true })
@@ -122,12 +120,12 @@ describe('test link marks', function () {
122120
})
123121

124122
it('Handles typed in markdown links with text', () => {
125-
const link = 'https://nextcloud.com/'
123+
const link = 'https://example.org/'
126124
cy.insertLine(`[text](${link})`)
127125
clickLink(link)
128126
cy.get('.link-view-bubble .widget-default', { timeout: 10000 })
129127
.find('.widget-default--name')
130-
.contains('Nextcloud')
128+
.contains('Example Domain')
131129
cy.get('.link-view-bubble a').should('have.attr', 'href', link)
132130
})
133131

@@ -163,9 +161,9 @@ describe('test link marks', function () {
163161
})
164162

165163
it('with protocol but without space', () => {
166-
cy.getContent().type('https://nextcloud.com')
164+
cy.getContent().type('https://example.org')
167165

168-
cy.getContent().find('a[href*="nextcloud.com"]').should('not.exist')
166+
cy.getContent().find('a[href*="example.org"]').should('not.exist')
169167
})
170168
})
171169

@@ -174,7 +172,7 @@ describe('test link marks', function () {
174172
const text = 'some text'
175173

176174
describe('link to website', function () {
177-
const url = 'https://nextcloud.com/'
175+
const url = 'https://example.org/'
178176
// Helper to reduce duplicated code, checking inserting with and without selected text
179177
const checkLinkWebsite = (url, text) => {
180178
cy.getSubmenuEntry('insert-link', 'insert-link-website').click()

cypress/e2e/inputRules.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('input rules', () => {
6262
})
6363

6464
it('link', () => {
65-
cy.getContent().type('[link](https://nextcloud.com/)')
65+
cy.getContent().type('[link](https://example.org/)')
6666
cy.getContent().find('a').should('contain', 'link')
6767
cy.closeFile()
6868
})

cypress/e2e/marks/Link.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ describe('Link marks', { retries: 0 }, () => {
2626

2727
it('will insert a link in a normal paragraph', () => {
2828
prepareEditor('hello\n', 3)
29-
editor.commands.insertOrSetLink('https://nextcloud.com', {
30-
href: 'https://nextcloud.com',
29+
editor.commands.insertOrSetLink('https://example.org', {
30+
href: 'https://example.org',
3131
})
32-
expectMarkdown(editor, 'he\n\n<https://nextcloud.com>\n\nllo')
32+
expectMarkdown(editor, 'he\n\n<https://example.org>\n\nllo')
3333
})
3434
})
3535

cypress/e2e/nodes/Preview.spec.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,25 @@ describe('Preview extension', { retries: 0 }, () => {
4747
})
4848

4949
it('cannot run on a paragraph with other content', () => {
50-
prepareEditor('[link text](https://nextcloud.com) hello\n')
50+
prepareEditor('[link text](https://example.org) hello\n')
5151
expect(editor.can().setPreview()).to.be.false
5252
})
5353

5454
it('convert a paragraph with a link', () => {
55-
prepareEditor('[link text](https://nextcloud.com)\n')
55+
prepareEditor('[link text](https://example.org)\n')
5656
editor.commands.setPreview()
5757
expectPreview()
5858
})
5959

6060
it('convert the second a paragraph with a link', () => {
61-
prepareEditor('hello\n\n[link text](https://nextcloud.com)\n')
61+
prepareEditor('hello\n\n[link text](https://example.org)\n')
6262
editor.commands.setTextSelection(10)
6363
editor.commands.setPreview()
6464
expectPreview()
6565
})
6666

6767
it('convert a paragraph with a link and a space', () => {
68-
prepareEditor('[link text](https://nextcloud.com)\n')
68+
prepareEditor('[link text](https://example.org)\n')
6969
editor.commands.insertContentAt(editor.state.doc.content.size - 1, ' ', {
7070
updateSelection: false,
7171
})
@@ -74,13 +74,13 @@ describe('Preview extension', { retries: 0 }, () => {
7474
})
7575

7676
it('results in a preview node with the href and text with link mark', () => {
77-
prepareEditor('[link text](https://nextcloud.com)\n')
77+
prepareEditor('[link text](https://example.org)\n')
7878
editor.commands.setPreview()
7979
expectPreview()
8080
})
8181

8282
it('cannot run twice', () => {
83-
prepareEditor('[link text](https://nextcloud.com)\n')
83+
prepareEditor('[link text](https://example.org)\n')
8484
editor.commands.setPreview()
8585
expect(editor.can().setPreview()).to.be.false
8686
})
@@ -97,23 +97,23 @@ describe('Preview extension', { retries: 0 }, () => {
9797
})
9898

9999
it('can run on the output of setPreview', () => {
100-
prepareEditor('[link text](https://nextcloud.com)\n')
100+
prepareEditor('[link text](https://example.org)\n')
101101
editor.commands.setPreview()
102102
expect(editor.can().unsetPreview()).to.be.true
103103
})
104104

105105
it('creates a paragraph', () => {
106-
prepareEditor('[link text](https://nextcloud.com)\n')
106+
prepareEditor('[link text](https://example.org)\n')
107107
editor.commands.setPreview()
108108
editor.commands.unsetPreview()
109109
expect(getParentNode().type.name).to.equal('paragraph')
110110
})
111111

112112
it('includes a link', () => {
113-
prepareEditor('[link text](https://nextcloud.com)\n')
113+
prepareEditor('[link text](https://example.org)\n')
114114
editor.commands.setPreview()
115115
editor.commands.unsetPreview()
116-
expect(getMark().attrs.href).to.equal('https://nextcloud.com')
116+
expect(getMark().attrs.href).to.equal('https://example.org')
117117
})
118118
})
119119

@@ -124,7 +124,7 @@ describe('Preview extension', { retries: 0 }, () => {
124124

125125
it('inserts a preview', () => {
126126
editor.commands.clearContent()
127-
editor.commands.insertPreview('https://nextcloud.com')
127+
editor.commands.insertPreview('https://example.org')
128128
editor.commands.setTextSelection(1)
129129
expectPreview()
130130
})
@@ -135,8 +135,8 @@ describe('Preview extension', { retries: 0 }, () => {
135135
*/
136136
function expectPreview() {
137137
expect(getParentNode().type.name).to.equal('preview')
138-
expect(getParentNode().attrs.href).to.equal('https://nextcloud.com')
139-
expect(getMark().attrs.href).to.equal('https://nextcloud.com')
138+
expect(getParentNode().attrs.href).to.equal('https://example.org')
139+
expect(getMark().attrs.href).to.equal('https://example.org')
140140
}
141141

142142
/**

cypress/e2e/nodes/PreviewOptions.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ describe('Preview Options', function () {
1818
cy.get('.entry-action__insert-link').click()
1919
cy.get('li').get('[data-text-action-entry="insert-link-website"]').click()
2020
cy.get('[data-text-action-entry="insert-link-input"] input').type(
21-
'nextcloud.com',
21+
'example.org',
2222
)
2323
cy.get('[data-text-action-entry="insert-link-input"] button').click()
2424

25-
cy.getContent().find(`a[href*="https://nextcloud.com"]`).click()
25+
cy.getContent().find(`a[href*="https://example.org"]`).click()
2626
cy.get('.link-options').click()
2727
})
2828

@@ -53,7 +53,7 @@ describe('Preview Options', function () {
5353
})
5454

5555
it('should Remove link', function () {
56-
cy.get('p > a').should('have.text', 'nextcloud.com')
56+
cy.get('p > a').should('have.text', 'example.org')
5757
cy.get('.action-button__text').contains('Remove link').click()
5858
cy.get('p > a').should('not.exist')
5959
})

cypress/fixtures/Preview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ empty
88

99
## Preserves a link
1010

11-
[link text](https://nextcloud.com)
11+
[link text](https://example.org)
1212

1313
---
1414

15-
[link text](https://nextcloud.com)
15+
[link text](https://example.org)
1616

1717
## Preserves a link preview - TODO
1818

19-
[link text](https://nextcloud.com (Preview))
19+
[link text](https://example.org (Preview))
2020

2121
---
2222

23-
[link text](https://nextcloud.com "Preview")
23+
[link text](https://example.org "Preview")

src/tests/components/RichTextReader.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ const test = baseTest.extend({
2222
},
2323
})
2424

25-
test.scoped({ content: '# Hello world\n\n[this is a link](https://nextcloud.com)' })
25+
test.scoped({ content: '# Hello world\n\n[this is a link](https://example.org)' })
2626
test('renders markdown', async ({ wrapper }) => {
2727
expect(wrapper.get('h1').text()).toBe('#Hello world') // # is the heading anchor
28-
expect(wrapper.get('a[href="https://nextcloud.com"]').text()).toBe(
28+
expect(wrapper.get('a[href="https://example.org"]').text()).toBe(
2929
'this is a link',
3030
)
3131
})
3232

3333
test('updates markdown', async ({ wrapper }) => {
3434
await wrapper.setProps({ content: '## Hello world' })
3535
expect(wrapper.get('h2').text()).toBe('#Hello world') // # is the heading anchor
36-
expect(wrapper.find('a[href="https://nextcloud.com"]').exists()).toBeFalsy()
36+
expect(wrapper.find('a[href="https://example.org"]').exists()).toBeFalsy()
3737
})

src/tests/markdown.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ describe('Markdown though editor', () => {
134134
})
135135

136136
test('preview with url only', () => {
137-
const entry = '[https://nextcloud.com](https://nextcloud.com (preview))'
137+
const entry = '[https://example.org](https://example.org (preview))'
138138
expect(markdownThroughEditor(entry)).toBe(entry)
139139
})
140140

141141
test('preview with text', () => {
142-
const entry = '[some other text](https://nextcloud.com (preview))'
142+
const entry = '[some other text](https://example.org (preview))'
143143
expect(markdownThroughEditor(entry)).toBe(entry)
144144
})
145145

src/tests/markdownit/preview.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ import markdownit from '../../markdownit/index.js'
77

88
describe('Preview extension', () => {
99
const link = {
10-
md: '[link](https://nextcloud.com)',
11-
html: '<a href="https://nextcloud.com">link</a>',
10+
md: '[link](https://example.org)',
11+
html: '<a href="https://example.org">link</a>',
1212
}
1313
const preview = {
14-
md: '[link](https://nextcloud.com (preview))',
15-
html: '<a href="https://nextcloud.com" title="preview">link</a>',
14+
md: '[link](https://example.org (preview))',
15+
html: '<a href="https://example.org" title="preview">link</a>',
1616
}
1717

1818
it('wraps', () => {
19-
expect(markdownit.render('[link](https://nextcloud.com)')).toBe(
20-
'<p><a href="https://nextcloud.com">link</a></p>\n',
19+
expect(markdownit.render('[link](https://example.org)')).toBe(
20+
'<p><a href="https://example.org">link</a></p>\n',
2121
)
2222
})
2323

src/tests/marks/Link.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Link from './../../marks/Link.js'
99
describe('Link extension integrated in the editor', () => {
1010
it('should have link available in commands', () => {
1111
const editor = createCustomEditor(
12-
'<p><a href="nextcloud.com">Test</a> HELLO WORLD</p>',
12+
'<p><a href="example.org">Test</a> HELLO WORLD</p>',
1313
[Link],
1414
)
1515
expect(editor.commands).toHaveProperty('insertOrSetLink')
@@ -18,7 +18,7 @@ describe('Link extension integrated in the editor', () => {
1818

1919
it('should update link if anchor has mark', () => {
2020
const editor = createCustomEditor(
21-
'<p><a href="nextcloud.com">Te<u>s</u>t</a> HELLO WORLD</p>',
21+
'<p><a href="example.org">Te<u>s</u>t</a> HELLO WORLD</p>',
2222
[Link, Underline],
2323
)
2424
editor.commands.setTextSelection(3)
@@ -29,7 +29,7 @@ describe('Link extension integrated in the editor', () => {
2929

3030
it('Should only update link the anchor is on', () => {
3131
const editor = createCustomEditor(
32-
'<p><a href="nextcloud.com">Test</a><a href="not-nextcloud.com">second link</a></p>',
32+
'<p><a href="example.org">Test</a><a href="not-example.org">second link</a></p>',
3333
[Link],
3434
)
3535
editor.commands.setTextSelection(3)
@@ -40,12 +40,12 @@ describe('Link extension integrated in the editor', () => {
4040

4141
it('should insert new link if none at anchor', () => {
4242
const editor = createCustomEditor(
43-
'<p><a href="nextcloud.com">Test</a> HELLO WORLD</p>',
43+
'<p><a href="example.org">Test</a> HELLO WORLD</p>',
4444
[Link],
4545
)
4646
editor.commands.setTextSelection(10)
4747
editor.commands.insertOrSetLink('new link', {
48-
href: 'https://nextcloud.com',
48+
href: 'https://example.org',
4949
})
5050
expect(editor.getJSON()).toMatchSnapshot()
5151
editor.destroy()

0 commit comments

Comments
 (0)