1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-01-16 20:08:15 +01:00

add interface tests

This commit is contained in:
Arnab Sen 2022-04-17 23:10:09 +05:30
parent cb4d19d05c
commit fa7150b24f
No known key found for this signature in database
GPG Key ID: 255D0564BAEA8F9D
2 changed files with 19 additions and 1 deletions

View File

@ -1 +1,3 @@
{}
{
"chromeWebSecurity": false
}

View File

@ -32,4 +32,20 @@ describe('Testing interfaces', () => {
});
cy.get('.modal__content').should('not.exist');
});
it('Save button click should save the current work with a notification.', () => {
cy.get('#htmlCodeEl').type('Hello');
cy.on('window:confirm', text => {
expect(text).to.contains('Do you still want to continue saving locally?');
});
cy.get('#saveBtn').click();
cy.then(() => {
const ls = JSON.parse(localStorage.getItem('code'));
expect(ls).to.be.not.null;
expect(ls['title']).to.contain('Untitled');
});
});
});