2021-02-08 14:03:49 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2021-02-22 16:27:59 -05:00
|
|
|
describe('Short code gets replaced or rendered: ', () => {
|
2021-02-08 14:03:49 -05:00
|
|
|
beforeEach(() => {
|
|
|
|
cy.visitTestEditor()
|
|
|
|
})
|
|
|
|
|
2021-02-22 16:27:59 -05:00
|
|
|
describe('pdf', () => {
|
2021-02-08 14:03:49 -05:00
|
|
|
it('renders a plain link', () => {
|
2021-10-04 06:50:39 -04:00
|
|
|
cy.setCodemirrorContent(`{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}`)
|
2021-02-08 14:03:49 -05:00
|
|
|
cy.getMarkdownBody()
|
|
|
|
.find('a')
|
|
|
|
.should('have.attr', 'href', 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')
|
|
|
|
})
|
|
|
|
})
|
2021-02-22 16:27:59 -05:00
|
|
|
|
|
|
|
describe('slideshare', () => {
|
|
|
|
it('renders a plain link', () => {
|
2021-10-04 06:50:39 -04:00
|
|
|
cy.setCodemirrorContent(`{%slideshare example/123456789 %}`)
|
2021-11-19 12:04:04 -05:00
|
|
|
cy.getMarkdownBody().find('a').should('have.attr', 'href', 'https://www.slideshare.net/example/123456789')
|
2021-02-22 16:27:59 -05:00
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('speakerdeck', () => {
|
|
|
|
it('renders a plain link', () => {
|
2021-10-04 06:50:39 -04:00
|
|
|
cy.setCodemirrorContent(`{%speakerdeck example/123456789 %}`)
|
2021-11-19 12:04:04 -05:00
|
|
|
cy.getMarkdownBody().find('a').should('have.attr', 'href', 'https://speakerdeck.com/example/123456789')
|
2021-02-22 16:27:59 -05:00
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('youtube', () => {
|
2021-11-14 12:44:55 -05:00
|
|
|
it('renders click-shield', () => {
|
2021-10-04 06:50:39 -04:00
|
|
|
cy.setCodemirrorContent(`{%youtube YE7VzlLtp-4 %}`)
|
2021-12-25 10:44:24 -05:00
|
|
|
cy.getMarkdownBody().findByCypressId('click-shield-youtube')
|
2021-02-22 16:27:59 -05:00
|
|
|
})
|
|
|
|
})
|
2021-02-08 14:03:49 -05:00
|
|
|
})
|