1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-30 19:00:32 +02:00

Version 1.4.6: Optimize Print, add print button, fix text, update cypress tests

This commit is contained in:
trendschau
2021-06-13 15:43:26 +02:00
parent bc5c0734ff
commit 7da5da93f5
17 changed files with 133 additions and 95 deletions

View File

@@ -31,6 +31,7 @@ describe('Typemill Setup', function()
cy.get('.error').should('contain', 'Length between 5 - 20')
})
/*
it('fails without CSRF-token', function ()
{
cy.request({
@@ -45,8 +46,26 @@ describe('Typemill Setup', function()
}
})
.its('body')
.should('include', 'Failed CSRF check')
.should('include', 'The form has a timeout')
})
*/
it('fails without CSRF-token', function ()
{
cy.visit('/setup')
// enter correct data
cy.get('input[name="username"]').clear().type('trendschau')
cy.get('input[name="email"]').clear().type('trendschau@gmail.com')
cy.get('input[name="password"]').clear().type('password')
cy.get('#csrf_value').then(elem => {
elem.val('wrongvalue');
});
// submit and get validation errors
cy.get('form').submit()
cy.get('#flash-message').should('contain', 'form has a timeout')
})
it('submits valid form data and visit welcome and settings page', function ()
{

View File

@@ -10,17 +10,18 @@ describe('Typemill Initial Frontend', function()
/* has start and setup button */
cy.get('nav').find('a').should(($a) => {
expect($a).to.have.length(10)
expect($a).to.have.length(11)
expect($a[0].href).to.match(/welcome/)
expect($a[1].href).to.match(/welcome\/setup/)
expect($a[2].href).to.match(/welcome\/write-content/)
expect($a[3].href).to.match(/welcome\/get-help/)
expect($a[4].href).to.match(/welcome\/markdown-test/)
expect($a[5].href).to.match(/cyanine-theme/)
expect($a[6].href).to.match(/cyanine-theme\/landingpage/)
expect($a[7].href).to.match(/cyanine-theme\/colors-and-fonts/)
expect($a[8].href).to.match(/cyanine-theme\/footer/)
expect($a[9].href).to.match(/cyanine-theme\/content-elements/)
expect($a[1].href).to.match(/welcome\/setup-your-website/)
expect($a[2].href).to.match(/welcome\/manage-access/)
expect($a[3].href).to.match(/welcome\/write-content/)
expect($a[4].href).to.match(/welcome\/get-help/)
expect($a[5].href).to.match(/welcome\/markdown-test/)
expect($a[6].href).to.match(/cyanine-theme/)
expect($a[7].href).to.match(/cyanine-theme\/landingpage/)
expect($a[8].href).to.match(/cyanine-theme\/colors-and-fonts/)
expect($a[9].href).to.match(/cyanine-theme\/footer/)
expect($a[10].href).to.match(/cyanine-theme\/content-elements/)
})
})

View File

@@ -44,8 +44,8 @@ describe('Blox Editor', function()
cy.get('.navi-list')
.should('contain', 'Testpage')
.eq(2).find('a').should(($a) => {
expect($a).to.have.length(5)
expect($a[4].href).to.include('/welcome\/testpage')
expect($a).to.have.length(6)
expect($a[5].href).to.include('/welcome\/testpage')
})
})
@@ -277,7 +277,7 @@ describe('Blox Editor', function()
cy.get('.navi-list')
.not('contain', 'Testpage')
.eq(2).find('a').should(($a) => {
expect($a).to.have.length(4)
expect($a).to.have.length(5)
})
})
})

View File

@@ -43,22 +43,6 @@ describe('Typemill Login', function()
cy.contains('Logout').click()
cy.url().should('include', '/tm/login')
})
it('fails without CSRF-token', function ()
{
cy.request({
method: 'POST',
url: '/tm/login', // baseUrl is prepended to url
form: true, // indicates the body should be form urlencoded and sets Content-Type: application/x-www-form-urlencoded headers
failOnStatusCode: false,
body: {
username: 'trendschau',
password: 'password'
}
})
.its('body')
.should('include', 'Failed CSRF check')
})
it('blocks after 3 fails', function ()
{
@@ -82,6 +66,6 @@ describe('Typemill Login', function()
cy.get('form').submit()
cy.get('#flash-message').should('contain', 'Too many bad logins')
cy.contains('wait')
cy.contains('Forgot password')
cy.contains('forgot password')
})
})