mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-24 18:31:57 +00:00
b42cb8fc49
* Update dependency cypress to v7 Signed-off-by: Renovate Bot <bot@renovateapp.com> * Use global beforeEach for config loading Signed-off-by: Erik Michelson <github@erik.michelson.eu> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Erik Michelson <github@erik.michelson.eu>
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
describe('Short code gets replaced or rendered: ', () => {
|
|
beforeEach(() => {
|
|
cy.visitTestEditor()
|
|
})
|
|
|
|
describe('pdf', () => {
|
|
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')
|
|
})
|
|
})
|
|
|
|
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')
|
|
})
|
|
})
|
|
})
|