Skip to content

Commit

Permalink
fix: New attempt to reload file list
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and max-nextcloud committed Aug 21, 2023
1 parent 7b8c010 commit 335d67b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
6 changes: 3 additions & 3 deletions cypress/e2e/attachments.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,14 @@ describe('Test all attachment insertion methods', () => {

it('[share] check everything behaves correctly on the share target user side', () => {
// check the file list
cy.get('test.md')
cy.getFile('test.md')
.should('contain', 'test.md')
cy.get('github.png')
cy.getFile('github.png')
.should('not.exist')
cy.showHiddenFiles()

// check the attachment folder is not there
cy.get('test.md')
cy.getFile('test.md')
.should('exist')
.should('have.attr', 'data-cy-files-list-row-fileid')
.then((documentId) => {
Expand Down
8 changes: 1 addition & 7 deletions cypress/e2e/nodes/Mentions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@ const currentUser = user

const fileName = 'empty.md'

const refresh = () => {
cy.get('.files-controls .crumb:not(.hidden) a')
.last()
.click({ force: true })
}

const createFileWithMention = (target, userToMention) => {
const content = `Hello @[${userToMention}](mention://user/${userToMention})`
cy.createFile(target, content)
.then(refresh)
.then(() => cy.reloadFileList())
}

describe('Test mentioning users', () => {
Expand Down
11 changes: 5 additions & 6 deletions cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Workspace', function() {
cy.uploadFile('test.md', 'text/markdown', `${currentFolder}/README.md`)
cy.createFolder(`${currentFolder}/subdirectory`)
cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`)
cy.getFile('README.md').should('contain', 'README.md')
cy.getFile('README.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
cy.openFolder('subdirectory')
Expand All @@ -56,7 +56,7 @@ describe('Workspace', function() {
it('Hides the workspace when switching to another view', function() {
cy.uploadFile('test.md', 'text/markdown', `${currentFolder}/README.md`)
cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`)
cy.getFile('README.md').should('contain', 'README.md')
cy.getFile('README.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
cy.get('a[href*="/apps/files/recent"]')
Expand Down Expand Up @@ -121,7 +121,7 @@ describe('Workspace', function() {
it('takes README.md into account', function() {
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/README.md`)
cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`)
cy.getFile('README.md').should('contain', 'README.md')
cy.getFile('README.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
})
Expand Down Expand Up @@ -238,7 +238,7 @@ describe('Workspace', function() {
cy.modifyUser(user, 'language', 'de_DE')
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/Anleitung.md`)
cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`)
cy.getFile('Anleitung.md').should('contain', 'Anleitung.md')
cy.getFile('Anleitung.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
})
Expand All @@ -247,7 +247,7 @@ describe('Workspace', function() {
cy.modifyUser(user, 'language', 'fr')
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/Anleitung.md`)
cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`)
cy.getFile('Anleitung.md').should('contain', 'Anleitung.md')
cy.getFile('Anleitung.md')
})
})

Expand Down Expand Up @@ -291,7 +291,6 @@ describe('Workspace', function() {
})

const openSidebar = filename => {
cy.getFile(filename).should('contain', filename)
cy.getFile(filename).find('.files-list__row-mtime').click()
cy.get('.app-sidebar-header').should('contain', filename)
}
Expand Down
5 changes: 3 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,9 @@ Cypress.Commands.add('propfindFolder', (path, depth = 0) => {
})
})

// FIXME: proper file list reload only once that is possible with the vue files app
Cypress.Commands.add('reloadFileList', () => cy.reload())
Cypress.Commands.add('reloadFileList', () => {
return cy.reload()
})

Cypress.Commands.add('openFolder', (name) => {
const url = `**/${encodeURI(name)}`
Expand Down

0 comments on commit 335d67b

Please sign in to comment.