mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
Add e2e tests for diagrams and embeddings (#1025)
This commit is contained in:
parent
c2664b68f0
commit
f9809a4edf
9 changed files with 187 additions and 14 deletions
|
@ -4,12 +4,12 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
describe('Short code', () => {
|
||||
describe('Short code gets replaced or rendered: ', () => {
|
||||
beforeEach(() => {
|
||||
cy.visitTestEditor()
|
||||
})
|
||||
|
||||
describe('for pdfs', () => {
|
||||
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()
|
||||
|
@ -17,4 +17,30 @@ describe('Short code', () => {
|
|||
.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')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue