Skip to content

Commit

Permalink
✅ (#2345): fix viewer tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
  • Loading branch information
Vinicius Reis committed May 23, 2022
1 parent c7a7723 commit 6e83554
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions cypress/integration/viewer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*
*/


import { randHash } from '../utils/'
const randUser = randHash()

Expand Down Expand Up @@ -61,9 +60,8 @@ describe('Open test.md in viewer', function() {
editor.get('h2').should('contain', 'Hello world')

cy.log('Inspect menubar')
const menubar = editor.get('.menubar .menubar-icons')
menubar.get('.icon-undo').should('be.visible')
menubar.get('.icon-bold').should('be.visible')
cy.getActionEntry('undo').should('be.visible')
cy.getActionEntry('bold').should('be.visible')

cy.screenshot()
})
Expand Down
5 changes: 3 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ Cypress.Commands.add('getEditor', () => {
return cy.get('[data-text-el="editor-container"]')
})

Cypress.Commands.add('getMenu', () => {
return cy.getEditor().find('[data-text-el="menubar"]')
Cypress.Commands.add('getMenu', { prevSubject: 'optional' }, (subject) => {
return (subject ? cy.wrap(subject) : cy.getEditor())
.find('[data-text-el="menubar"]')
})

Cypress.Commands.add('getActionEntry', { prevSubject: 'optional' }, (subject, name) => {
Expand Down

0 comments on commit 6e83554

Please sign in to comment.