mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Add quote extra markdown it plugin (#1020)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
7f6e0e53a7
commit
5b1940f0ba
10 changed files with 309 additions and 160 deletions
75
cypress/integration/quote-extra.spec.ts
Normal file
75
cypress/integration/quote-extra.spec.ts
Normal file
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
describe('Quote extra tags', function () {
|
||||
beforeEach(() => {
|
||||
cy.visitTestEditor()
|
||||
})
|
||||
|
||||
describe('Name quote tag', () => {
|
||||
it('renders correctly', () => {
|
||||
cy.codemirrorFill('[name=testy mctestface]')
|
||||
|
||||
cy.getMarkdownBody()
|
||||
.find('.quote-extra')
|
||||
.should('be.visible')
|
||||
.find('.fa-user')
|
||||
.should('be.visible')
|
||||
|
||||
cy.getMarkdownBody()
|
||||
.find('.quote-extra')
|
||||
.should('be.visible')
|
||||
.contains('testy mctestface')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Time quote tag', () => {
|
||||
it('renders correctly', () => {
|
||||
cy.codemirrorFill(`[time=always]`)
|
||||
|
||||
cy.getMarkdownBody()
|
||||
.find('.quote-extra')
|
||||
.should('be.visible')
|
||||
.find('.fa-clock-o')
|
||||
.should('be.visible')
|
||||
|
||||
cy.getMarkdownBody()
|
||||
.find('.quote-extra')
|
||||
.should('be.visible')
|
||||
.contains('always')
|
||||
})
|
||||
})
|
||||
|
||||
describe('Color quote tag', () => {
|
||||
it('renders correctly', () => {
|
||||
cy.codemirrorFill(`[color=#b51f08]`)
|
||||
|
||||
cy.getMarkdownBody()
|
||||
.find('.quote-extra')
|
||||
.should('be.visible')
|
||||
.find('.fa-tag')
|
||||
.should('be.visible')
|
||||
|
||||
cy.getMarkdownBody()
|
||||
.find('.quote-extra')
|
||||
.should('be.visible')
|
||||
.should('have.css', 'color', 'rgb(181, 31, 8)')
|
||||
})
|
||||
|
||||
it('doesn\'t render in a blockquote and dyes the blockquote border', () => {
|
||||
cy.codemirrorFill(`> [color=#b51f08] HedgeDoc`)
|
||||
|
||||
cy.getMarkdownBody()
|
||||
.find('.quote-extra')
|
||||
.should('not.exist')
|
||||
|
||||
cy.getMarkdownBody()
|
||||
.find('blockquote')
|
||||
.should('be.visible')
|
||||
.should('have.css', 'border-left-color', 'rgb(181, 31, 8)')
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue