Add ability to use yaml-array for tags (#874)

This commit is contained in:
Erik Michelson 2021-01-04 13:01:34 +01:00 committed by GitHub
parent bf42b9c460
commit b2cf2f134e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 107 additions and 9 deletions

View file

@ -0,0 +1,37 @@
/*
* SPDX-FileCopyrightText: 2020 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
describe('yaml-metadata: tags', () => {
beforeEach(() => {
cy.visit('/n/features')
cy.get('.CodeMirror textarea')
.type('{ctrl}a', { force: true })
.type('{backspace}')
})
it('show deprecation notice on old syntax', () => {
cy.get('.CodeMirror textarea')
.type('---\ntags: a, b, c\n---')
cy.get('.splitter.right .w-100.h-100 .alert.alert-warning')
.should('be.visible')
})
it('show no deprecation notice on yaml-array (1)', () => {
cy.get('.CodeMirror textarea')
.type('---\ntags: [\'a\', \'b\', \'c\']\n---')
cy.get('.splitter.right .w-100.h-100 .alert.alert-warning')
.should('not.exist')
})
it('show no deprecation notice on yaml-array (2)', () => {
cy.get('.CodeMirror textarea')
.type('---\ntags:\n - a\nb\nc\n')
.type('{backspace}{backspace}{backspace}{backspace}')
.type('---')
cy.get('.splitter.right .w-100.h-100 .alert.alert-warning')
.should('not.exist')
})
})