mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -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,52 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { testNoteId } from '../support/visit-test-editor'
|
||||
|
||||
describe('Delete note', () => {
|
||||
beforeEach(() => {
|
||||
cy.visitTestNote()
|
||||
})
|
||||
|
||||
it('correctly deletes a note', () => {
|
||||
cy.intercept('DELETE', `/api/mock-backend/private/notes/${testNoteId}`, {
|
||||
statusCode: 204
|
||||
})
|
||||
cy.getByCypressId('sidebar.deleteNote.button').click()
|
||||
cy.getByCypressId('sidebar.deleteNote.modal').should('be.visible')
|
||||
cy.getByCypressId('sidebar.deleteNote.modal.noteTitle').should('be.visible').text().should('eq', '')
|
||||
cy.getByCypressId('deletionModal.confirmButton').should('be.visible').click()
|
||||
cy.getByCypressId('sidebar.deleteNote.modal').should('not.be.exist')
|
||||
cy.getByCypressId('notification-toast').should('not.exist')
|
||||
})
|
||||
|
||||
it('displays an error notification if something goes wrong', () => {
|
||||
cy.getByCypressId('sidebar.deleteNote.button').click()
|
||||
cy.getByCypressId('sidebar.deleteNote.modal').should('be.visible')
|
||||
cy.getByCypressId('sidebar.deleteNote.modal.noteTitle').should('be.visible').text().should('eq', '')
|
||||
cy.getByCypressId('deletionModal.confirmButton').should('be.visible').click()
|
||||
cy.getByCypressId('sidebar.deleteNote.modal').should('not.exist')
|
||||
cy.getByCypressId('notification-toast').should('be.visible')
|
||||
})
|
||||
|
||||
describe('displays the note title coming from', () => {
|
||||
const title = 'mock_title'
|
||||
it('yaml metadata', () => {
|
||||
cy.setCodemirrorContent(`---\ntitle: ${title}\n---`)
|
||||
})
|
||||
it('opengraph', () => {
|
||||
cy.setCodemirrorContent(`---\nopengraph:\n title: ${title}\n---`)
|
||||
})
|
||||
it('just first heading', () => {
|
||||
cy.setCodemirrorContent(`# ${title}`)
|
||||
})
|
||||
afterEach(() => {
|
||||
cy.getByCypressId('sidebar.deleteNote.button').click()
|
||||
cy.getByCypressId('sidebar.deleteNote.modal').should('be.visible')
|
||||
cy.getByCypressId('sidebar.deleteNote.modal.noteTitle').should('be.visible').text().should('eq', title)
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue