Skip to content

Commit

Permalink
test: open different mimetypes
Browse files Browse the repository at this point in the history
Just `text/plain` and `text/markdown` for now.
Also provide some docs how to add more mimetypes to text.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Dec 8, 2022
1 parent 15a66bb commit 0d01bbc
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions cypress/e2e/files.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,29 @@ import { randUser } from '../utils/index.js'

const user = randUser()

describe('Files default view', () => {
describe('Text and server mimetypes', () => {
before(() => {
cy.createUser(user)
})

beforeEach(() => {
cy.login(user)
cy.visit('/apps/files')
})

it('See the default files list', () => {
cy.get('#app-content-files table tr').should('contain', 'welcome.txt')
it('handle plaintext in a pre tag', () => {
cy.uploadFile('empty.md', 'text/plain', 'textfile.txt')
cy.visit('/apps/files')
cy.get('#app-content-files table tr').should('contain', 'textfile.txt')
cy.openFile('textfile.txt')
cy.getContent().find('pre').should('exist')
})

it('Take screenshot', () => {
cy.screenshot()
it('handle markdown with richtext editor', () => {
cy.uploadFile('test.md', 'text/markdown', 'markdown.md')
cy.visit('/apps/files')
cy.get('#app-content-files table tr').should('contain', 'markdown.md')
cy.openFile('markdown.md')
cy.getContent().find('h2').should('contain', 'Hello world')
})

})

0 comments on commit 0d01bbc

Please sign in to comment.