Skip to content

Commit

Permalink
style: Fix code style in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Feb 28, 2024
1 parent c1bcee7 commit b310305
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cypress/e2e/openreadonly.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { randUser } from '../utils/index.js'
const admin = new User('admin', 'admin')
const user = randUser()

describe('Open read-only mode', function () {
describe('Open read-only mode', function() {

const setReadOnlyMode = function (mode) {
const setReadOnlyMode = function(mode) {
cy.login(admin)
cy.ocsRequest({
method: 'POST',
Expand All @@ -18,13 +18,13 @@ describe('Open read-only mode', function () {
cy.logout()
}

describe('Disabled', function () {
const checkMenubar = function () {
describe('Disabled', function() {
const checkMenubar = function() {
cy.get('.text-editor--readonly-bar').should('not.exist')
cy.get('.text-menubar').getActionEntry('done').should('not.exist')
}

beforeEach(function () {
beforeEach(function() {
setReadOnlyMode(0)

cy.createUser(user)
Expand All @@ -36,29 +36,29 @@ describe('Open read-only mode', function () {
cy.visit('/apps/files')
})

it('Test writable markdown file', function () {
it('Test writable markdown file', function() {
cy.openFile('test.md')
checkMenubar()
})

it('Test writable text file', function () {
it('Test writable text file', function() {
cy.openFile('test.txt')
checkMenubar()
})
})

describe('Enabled', function () {
const requireReadOnlyBar = function () {
describe('Enabled', function() {
const requireReadOnlyBar = function() {
cy.get('.text-editor--readonly-bar').should('exist')
cy.get('.text-editor--readonly-bar').getActionEntry('edit').should('exist')
}

const requireMenubar = function () {
const requireMenubar = function() {
cy.get('.text-editor--readonly-bar').should('not.exist')
cy.get('.text-menubar').getActionEntry('done').should('exist')
}

beforeEach(function () {
beforeEach(function() {
setReadOnlyMode(1)

cy.createUser(user)
Expand All @@ -73,7 +73,7 @@ describe('Open read-only mode', function () {
cy.visit('/apps/files')
})

it('Test read-only markdown file', function () {
it('Test read-only markdown file', function() {
cy.openFile('test.md')

requireReadOnlyBar()
Expand All @@ -89,7 +89,7 @@ describe('Open read-only mode', function () {
requireReadOnlyBar()
})

it('Test read-only text file', function () {
it('Test read-only text file', function() {
cy.openFile('test.txt')

requireReadOnlyBar()
Expand Down

0 comments on commit b310305

Please sign in to comment.