Extract general popups markup to its own component

Split popups controllers into separate components
Implemented storybooks for all project's popups
This commit is contained in:
ErickSkrauch
2020-07-06 19:29:56 +03:00
parent 28ccab8a98
commit 82abe0a746
39 changed files with 834 additions and 534 deletions

View File

@@ -35,7 +35,7 @@ describe('feedback popup', () => {
cy.findByTestId('feedbackPopup').should('contain', 'Your message was received');
cy.findByTestId('feedbackPopup').should('contain', account1.email);
cy.findByTestId('feedback-popup-close-button').click();
cy.findByTestId('feedbackPopup').find('button').contains('Close').click();
cy.findByTestId('feedbackPopup').should('not.be.visible');
});

View File

@@ -1,5 +1,5 @@
describe('Change locale', () => {
it('should change locale from footer', () => {
it('should change locale from the footer', () => {
cy.visit('/');
cy.findByTestId('footer').contains('Site language').click();
@@ -7,7 +7,7 @@ describe('Change locale', () => {
cy.findByTestId('language-switcher').should('be.visible');
cy.findByTestId('language-switcher').should('have.attr', 'data-e2e-active-locale', 'en');
cy.findByTestId('language-list').contains('Belarusian').click();
cy.findByTestId('languages-list-item').contains('Belarusian').click();
cy.findByTestId('language-switcher').should('not.be.visible');
@@ -16,13 +16,13 @@ describe('Change locale', () => {
cy.findByTestId('language-switcher').should('be.visible');
cy.findByTestId('language-switcher').should('have.attr', 'data-e2e-active-locale', 'be');
cy.findByTestId('language-list').contains('English').click();
cy.findByTestId('languages-list-item').contains('English').click();
cy.findByTestId('language-switcher').should('not.be.visible');
cy.findByTestId('footer').should('contain', 'Site language');
});
it('should change locale from profile', () => {
it('should change locale from the profile', () => {
cy.login({ accounts: ['default'] }).then(({ accounts: [account] }) => {
cy.server();
cy.route({
@@ -39,7 +39,7 @@ describe('Change locale', () => {
cy.findByTestId('language-switcher').should('be.visible');
cy.findByTestId('language-switcher').should('have.attr', 'data-e2e-active-locale', 'en');
cy.findByTestId('language-list').contains('Belarusian').click();
cy.findByTestId('languages-list-item').contains('Belarusian').click();
cy.wait('@language').its('requestBody').should('eq', 'lang=be');