2021-02-08 17:29:02 +00:00
|
|
|
/*
|
2022-06-08 11:19:51 +00:00
|
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
2021-02-08 17:29:02 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
describe('Quote extra tags', function () {
|
|
|
|
beforeEach(() => {
|
2022-01-30 20:46:43 +00:00
|
|
|
cy.visitTestNote()
|
2021-02-08 17:29:02 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
describe('Name quote tag', () => {
|
|
|
|
it('renders correctly', () => {
|
2021-10-04 10:50:39 +00:00
|
|
|
cy.setCodemirrorContent('[name=testy mctestface]')
|
2021-02-08 17:29:02 +00:00
|
|
|
|
2021-11-19 17:04:04 +00:00
|
|
|
cy.getMarkdownBody().find('.blockquote-extra').should('be.visible').find('.fa-user').should('be.visible')
|
2021-02-08 17:29:02 +00:00
|
|
|
|
2021-11-19 17:04:04 +00:00
|
|
|
cy.getMarkdownBody().find('.blockquote-extra').should('be.visible').contains('testy mctestface')
|
2021-02-08 17:29:02 +00:00
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Time quote tag', () => {
|
|
|
|
it('renders correctly', () => {
|
2021-10-04 10:50:39 +00:00
|
|
|
cy.setCodemirrorContent(`[time=always]`)
|
2021-02-08 17:29:02 +00:00
|
|
|
|
2021-11-19 17:04:04 +00:00
|
|
|
cy.getMarkdownBody().find('.blockquote-extra').should('be.visible').find('.fa-clock-o').should('be.visible')
|
2021-02-08 17:29:02 +00:00
|
|
|
|
2021-11-19 17:04:04 +00:00
|
|
|
cy.getMarkdownBody().find('.blockquote-extra').should('be.visible').contains('always')
|
2021-02-08 17:29:02 +00:00
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Color quote tag', () => {
|
|
|
|
it('renders correctly', () => {
|
2021-10-04 10:50:39 +00:00
|
|
|
cy.setCodemirrorContent(`[color=#b51f08]`)
|
2021-02-08 17:29:02 +00:00
|
|
|
|
2021-11-19 17:04:04 +00:00
|
|
|
cy.getMarkdownBody().find('.blockquote-extra').should('be.visible').find('.fa-tag').should('be.visible')
|
2021-02-08 17:29:02 +00:00
|
|
|
|
2021-11-19 17:04:04 +00:00
|
|
|
cy.getMarkdownBody().find('.blockquote-extra').should('be.visible').should('have.css', 'color', 'rgb(181, 31, 8)')
|
2021-02-08 17:29:02 +00:00
|
|
|
})
|
|
|
|
|
2021-11-19 17:04:04 +00:00
|
|
|
it("doesn't render in a blockquote and dyes the blockquote border", () => {
|
2021-10-04 10:50:39 +00:00
|
|
|
cy.setCodemirrorContent(`> [color=#b51f08] HedgeDoc`)
|
2021-02-08 17:29:02 +00:00
|
|
|
|
2021-11-19 17:04:04 +00:00
|
|
|
cy.getMarkdownBody().find('.blockquote-extra').should('not.exist')
|
2021-02-08 17:29:02 +00:00
|
|
|
|
|
|
|
cy.getMarkdownBody()
|
|
|
|
.find('blockquote')
|
|
|
|
.should('be.visible')
|
|
|
|
.should('have.css', 'border-left-color', 'rgb(181, 31, 8)')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|