mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 23:24:46 -04:00
changed calls to cy.route to cy.intercept (#806)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
bc7ff07256
commit
e0dbb05572
5 changed files with 87 additions and 49 deletions
|
@ -24,33 +24,66 @@ describe('History', () => {
|
|||
})
|
||||
|
||||
describe('Pinning', () => {
|
||||
beforeEach(() => {
|
||||
cy.route({
|
||||
method: 'PUT',
|
||||
url: '/api/v2/history/**',
|
||||
status: 401,
|
||||
response: {}
|
||||
describe('working', () => {
|
||||
beforeEach(() => {
|
||||
cy.intercept('PUT', '/api/v2/history/features', (req) => {
|
||||
req.reply(200, req.body)
|
||||
})
|
||||
})
|
||||
|
||||
it('Cards', () => {
|
||||
cy.get('div.card')
|
||||
.should('be.visible')
|
||||
cy.get('.history-pin.btn')
|
||||
.first()
|
||||
.as('pin-button')
|
||||
cy.get('@pin-button')
|
||||
.should('not.have.class', 'pinned')
|
||||
.click()
|
||||
cy.get('@pin-button')
|
||||
.should('have.class', 'pinned')
|
||||
})
|
||||
|
||||
it('Table', () => {
|
||||
cy.get('i.fa-table')
|
||||
.click()
|
||||
cy.get('.history-pin.btn')
|
||||
.first()
|
||||
.as('pin-button')
|
||||
cy.get('@pin-button')
|
||||
.should('not.have.class', 'pinned')
|
||||
.click()
|
||||
cy.get('@pin-button')
|
||||
.should('have.class', 'pinned')
|
||||
})
|
||||
})
|
||||
|
||||
it('Cards', () => {
|
||||
cy.get('div.card')
|
||||
.should('be.visible')
|
||||
cy.get('.fa-thumb-tack')
|
||||
.first()
|
||||
.click()
|
||||
cy.get('.modal-dialog')
|
||||
.should('be.visible')
|
||||
})
|
||||
describe('failing', () => {
|
||||
beforeEach(() => {
|
||||
cy.intercept('PUT', '/api/v2/history/features', {
|
||||
statusCode: 401
|
||||
})
|
||||
})
|
||||
|
||||
it('Table', () => {
|
||||
cy.get('i.fa-table')
|
||||
.click()
|
||||
cy.get('.fa-thumb-tack')
|
||||
.first()
|
||||
.click()
|
||||
cy.get('.modal-dialog')
|
||||
.should('be.visible')
|
||||
it('Cards', () => {
|
||||
cy.get('div.card')
|
||||
.should('be.visible')
|
||||
cy.get('.fa-thumb-tack')
|
||||
.first()
|
||||
.click()
|
||||
cy.get('.modal-dialog')
|
||||
.should('be.visible')
|
||||
})
|
||||
|
||||
it('Table', () => {
|
||||
cy.get('i.fa-table')
|
||||
.click()
|
||||
cy.get('.fa-thumb-tack')
|
||||
.first()
|
||||
.click()
|
||||
cy.get('.modal-dialog')
|
||||
.should('be.visible')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue