mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 00:54:43 -04:00
Update dependency cypress to v10 (#2095)
* Update dependency cypress to v10 * Migrate cypress files Signed-off-by: Renovate Bot <bot@renovateapp.com> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
e93607c96e
commit
040e11924f
34 changed files with 57 additions and 45 deletions
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { branding } from '../support/config'
|
||||
|
||||
const title = 'This is a test title'
|
||||
describe('Document Title', () => {
|
||||
beforeEach(() => {
|
||||
cy.visitTestNote()
|
||||
cy.getByCypressId('view-mode-both').should('exist')
|
||||
})
|
||||
|
||||
describe('title should be yaml metadata title', () => {
|
||||
it('just yaml metadata title', () => {
|
||||
cy.setCodemirrorContent(`---\ntitle: ${title}\n---`)
|
||||
cy.title().should('eq', `${title} - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
|
||||
it('yaml metadata title and opengraph title', () => {
|
||||
cy.setCodemirrorContent(`---\ntitle: ${title}\nopengraph:\n title: False title\n---`)
|
||||
cy.title().should('eq', `${title} - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
|
||||
it('yaml metadata title, opengraph title and first heading', () => {
|
||||
cy.setCodemirrorContent(`---\ntitle: ${title}\nopengraph:\n title: False title\n---\n# a first title`)
|
||||
cy.title().should('eq', `${title} - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
})
|
||||
|
||||
describe('title should be opengraph title', () => {
|
||||
it('just opengraph title', () => {
|
||||
cy.setCodemirrorContent(`---\nopengraph:\n title: ${title}\n---`)
|
||||
cy.title().should('eq', `${title} - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
|
||||
it('opengraph title and first heading', () => {
|
||||
cy.setCodemirrorContent(`---\nopengraph:\n title: ${title}\n---\n# a first title`)
|
||||
cy.title().should('eq', `${title} - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
})
|
||||
|
||||
describe('title should be first heading', () => {
|
||||
it('just first heading', () => {
|
||||
cy.setCodemirrorContent(`# ${title}`)
|
||||
cy.title().should('eq', `${title} - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
|
||||
it('just first heading with alt-text instead of image', () => {
|
||||
cy.setCodemirrorContent(`# ${title} `)
|
||||
cy.title().should('eq', `${title} abc - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
|
||||
it('just first heading without link syntax', () => {
|
||||
cy.setCodemirrorContent(`# ${title} [link](https://hedgedoc.org)`)
|
||||
cy.title().should('eq', `${title} link - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
|
||||
it('markdown syntax removed first', () => {
|
||||
cy.setCodemirrorContent(`# ${title} 1*2*3 4*5**`)
|
||||
cy.title().should('eq', `${title} 123 4*5** - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
|
||||
it('markdown syntax removed second', () => {
|
||||
cy.setCodemirrorContent(`# ${title} **1 2*`)
|
||||
cy.title().should('eq', `${title} *1 2 - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
|
||||
it('markdown syntax removed third', () => {
|
||||
cy.setCodemirrorContent(`# ${title} _asd_`)
|
||||
cy.title().should('eq', `${title} asd - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
|
||||
it('katex code looks right', () => {
|
||||
cy.setCodemirrorContent(`# $\\alpha$-foo`)
|
||||
cy.getIframeBody().find('h1').should('contain', 'α')
|
||||
//TODO: Remove workaround after https://github.com/hedgedoc/react-client/issues/1816 has been fixed.
|
||||
cy.get('.cm-editor .cm-content').type('{Enter}{Enter}{Enter}{Enter}{Enter}')
|
||||
cy.title().should('eq', `α-foo - HedgeDoc @ ${branding.name}`)
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue