Skip to content

Commit

Permalink
style: Changes according to eslint
Browse files Browse the repository at this point in the history
--signoff

Signed-off-by: Philipp Hempel <philipp.hempel@nextcloud.com>
  • Loading branch information
Philipp Hempel authored and Hephi2 committed May 23, 2023
1 parent cbfbec5 commit a897ced
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions cypress/e2e/workspace.spec.js
Expand Up @@ -84,16 +84,15 @@ describe('Workspace', function() {
.should('be.visible')
})

it('formats text', function() {
it('formats text', function() {
cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`)
cy.openWorkspace()

;const buttons = [
const buttons = [
['bold', 'strong'],
['italic', 'em'],
['underline', 'u'],
['strikethrough', 's'],
]
]
buttons.forEach(([button, tag]) => testButtonUnselected(button, tag))
cy.getContent().type('Format me{selectall}')
buttons.forEach(([button, tag]) => testButton(button, tag, 'Format me'))
Expand Down Expand Up @@ -330,16 +329,18 @@ function testButton(button, tag, content) {
*
* @param {string} button Name of the button to click.
* @param {string} tag Html tag expected to be toggled.
* @param {string} content Content expected in the element.
*/
function testButtonUnselected(button, tag) {
cy.getMenuEntry(button).click().should('have.class', 'is-active')
cy.getMenuEntry(button).click()
cy.getMenuEntry(button).should('have.class', 'is-active')
cy.getContent().type('Format me{selectall}')
.find(`${tag}`)
cy.getContent().find(`${tag}`)
.should('contain', 'Format me').type('{del}')
cy.getMenuEntry(button).click().should('have.class', 'is-active').click().should('not.have.class', 'is-active')
cy.getMenuEntry(button).click()
cy.getMenuEntry(button).should('have.class', 'is-active').click()
cy.getMenuEntry(button).should('not.have.class', 'is-active')
cy.getContent().type('Format me{selectall}')
.find(`${tag}`)
cy.getMenuEntry(button).find(`${tag}`)
.should('not.exist')
cy.getContent().type('{del}')
}
2 changes: 1 addition & 1 deletion src/components/Menu/ActionSingle.vue
Expand Up @@ -69,7 +69,7 @@ export default {
},
mounted() {
this.$editor.on("transaction", () => this.updateState());
this.$editor.on('transaction', () => this.updateState())
},
methods: {
runAction() {
Expand Down

0 comments on commit a897ced

Please sign in to comment.