2021-02-08 19:03:49 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2021-02-22 21:27:59 +00:00
|
|
|
describe('Short code gets replaced or rendered: ', () => {
|
2021-02-08 19:03:49 +00:00
|
|
|
beforeEach(() => {
|
2021-03-09 22:00:14 +00:00
|
|
|
cy.loadConfig()
|
2021-02-08 19:03:49 +00:00
|
|
|
cy.visitTestEditor()
|
|
|
|
})
|
|
|
|
|
2021-02-22 21:27:59 +00:00
|
|
|
describe('pdf', () => {
|
2021-02-08 19:03:49 +00:00
|
|
|
it('renders a plain link', () => {
|
|
|
|
cy.codemirrorFill(`{%pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf %}`)
|
|
|
|
cy.getMarkdownBody()
|
|
|
|
.find('a')
|
|
|
|
.should('have.attr', 'href', 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf')
|
|
|
|
})
|
|
|
|
})
|
2021-02-22 21:27:59 +00:00
|
|
|
|
|
|
|
describe('slideshare', () => {
|
|
|
|
it('renders a plain link', () => {
|
|
|
|
cy.codemirrorFill(`{%slideshare example/123456789 %}`)
|
|
|
|
cy.getMarkdownBody()
|
|
|
|
.find('a')
|
|
|
|
.should('have.attr', 'href', 'https://www.slideshare.net/example/123456789')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('speakerdeck', () => {
|
|
|
|
it('renders a plain link', () => {
|
|
|
|
cy.codemirrorFill(`{%speakerdeck example/123456789 %}`)
|
|
|
|
cy.getMarkdownBody()
|
|
|
|
.find('a')
|
|
|
|
.should('have.attr', 'href', 'https://speakerdeck.com/example/123456789')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('youtube', () => {
|
|
|
|
it('renders one-click-embedding', () => {
|
|
|
|
cy.codemirrorFill(`{%youtube YE7VzlLtp-4 %}`)
|
|
|
|
cy.getMarkdownBody()
|
|
|
|
.find('.one-click-embedding.embed-responsive-item')
|
|
|
|
})
|
|
|
|
})
|
2021-02-08 19:03:49 +00:00
|
|
|
})
|