Skip to content

Commit

Permalink
fix(cypress): Folder shares use new Files vue frontend now
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Sep 9, 2024
1 parent 122ba83 commit b77e994
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/nodes/CodeBlock.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('Front matter support', function() {
cy.getContent().find('code').eq(1).find('.hljs-keyword').eq(1).contains('function')

// Mermaid diagram
cy.get('#app-content').scrollTo('bottom')
cy.getEditor().scrollTo('bottom')
cy.getContent().find('.split-view__preview').eq(2).should('be.visible')
cy.get('.code-block').eq(2).find('code').should('not.be.visible')
cy.get('.split-view__preview').find('svg .entityTitleText')
Expand Down
6 changes: 3 additions & 3 deletions cypress/e2e/share.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('Open test.md in viewer', function() {
return cy.visit(`/s/${token}`)
})
.then(() => {
cy.openFileInShare('test.md')
cy.openFile('test.md')
cy.getModal().getContent().should('be.visible')
cy.getModal().getContent().should('contain', 'Hello world')
cy.getModal().getContent().find('h2').should('contain', 'Hello world')
Expand All @@ -105,8 +105,8 @@ describe('Open test.md in viewer', function() {
})
})

it('Opens the editor as guest', function() {
cy.shareFile('/test3.md')
it('Opens the editor as guest and set a session username', function() {
cy.shareFile('/test3.md', { edit: true })
.then((token) => {
cy.logout()
cy.visit(`/s/${token}`)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,6 @@ Cypress.Commands.add('openFile', (fileName, params = {}) => {
cy.get(`[data-cy-files-list] tr[data-cy-files-list-row-name="${fileName}"] [data-cy-files-list-row-name-link]`).click(params)
})

Cypress.Commands.add('openFileInShare', fileName => {
cy.get(`.files-fileList tr[data-file="${CSS.escape(fileName)}"] a.name`).click()
// eslint-disable-next-line
cy.wait(250)
})

Cypress.Commands.add('closeFile', (params = {}) => {
cy.intercept({ method: 'POST', url: '**/apps/text/session/*/close' })
.as('close')
Expand Down

0 comments on commit b77e994

Please sign in to comment.