Skip to content

Commit

Permalink
more renaming
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliushaertl committed Aug 18, 2023
1 parent 5ca136b commit 247deb6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/nodes/ImageView.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ describe('Image View', () => {
})

it('with preview', () => {
cy.get('.files-fileList tr[data-file="github.png"]')
.should('have.attr', 'data-id')
cy.getFile('github.png')
.should('have.attr', 'data-cy-files-list-row-fileid')
.then(imageId => {
const fileName = `${Cypress.currentTest.title}.md`

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/viewer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Open test.md in viewer', function() {
})

it('See test.md in the list', function() {
cy.get('.files-fileList tr[data-file="test.md"]', { timeout: 10000 })
cy.getFile('test.md')
.should('contain', 'test.md')
})

Expand Down
18 changes: 8 additions & 10 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.get('.files-fileList').should('contain', 'README.md')
cy.getFile('README.md').should('contain', '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.get('.files-fileList').should('contain', 'README.md')
cy.getFile('README.md').should('contain', 'README.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
cy.get('a[href*="/apps/files/recent"]')
Expand All @@ -71,7 +71,7 @@ describe('Workspace', function() {
.as('addDescription')

cy.visit(`apps/files?dir=/${encodeURIComponent(currentFolder)}`)
cy.get('.files-fileList').should('not.contain', 'Readme.md')
cy.getFile('README.md').should('not.contain', 'Readme.md')

cy.get('.files-controls').first().within(() => {
cy.get('.button.new').click()
Expand Down Expand Up @@ -133,7 +133,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.get('.files-fileList').should('contain', 'README.md')
cy.getFile('README.md').should('contain', 'README.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
})
Expand Down Expand Up @@ -250,7 +250,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.get('.files-fileList').should('contain', 'Anleitung.md')
cy.getFile('Anleitung.md').should('contain', 'Anleitung.md')
cy.get('#rich-workspace .ProseMirror')
.should('contain', 'Hello world')
})
Expand All @@ -259,7 +259,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.get('.files-fileList').should('contain', 'Anleitung.md')
cy.getFile('Anleitung.md').should('contain', 'Anleitung.md')
})
})

Expand Down Expand Up @@ -303,10 +303,8 @@ describe('Workspace', function() {
})

const openSidebar = filename => {
cy.get(`.files-fileList tr[data-file="${filename}"]`)
.should('contain', filename)
cy.get(`.files-fileList tr[data-file="${filename}"] .icon-more`).click()
cy.get(`.files-fileList tr[data-file="${filename}"] .icon-details`).click()
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
6 changes: 3 additions & 3 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ Cypress.Commands.add('getFile', fileName => {
})

Cypress.Commands.add('deleteFile', fileName => {
cy.get(`.files-fileList tr[data-file="${fileName}"] a.name .action-menu`).click()
cy.get(`.files-fileList tr[data-file="${fileName}"] a.name + .popovermenu .action-delete`).click()
cy.get(`.files-fileList tr[data-file="${fileName}"]`).should('not.exist')
cy.get(`[data-cy-files-list] tr[data-cy-files-list-row-name="${fileName}"] .files-list__row-actions butotn`).click()
cy.get(`.files-list__row-action-delete button`).click()

Check failure on line 318 in cypress/support/commands.js

View workflow job for this annotation

GitHub Actions / eslint

Strings must use singlequote
cy.get(`[data-cy-files-list] tr[data-cy-files-list-row-name="${fileName}"]`).should('not.exist')
})

Cypress.Commands.add('getModal', () => {
Expand Down

0 comments on commit 247deb6

Please sign in to comment.