-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display error banners when saving duplicate template category and ema…
…il branding entities (#2094) * Display banners when saving duplicates - Banners will now be displayed when saving duplicate template categories or email branding - Added error message FR translations * Fix punctuation in translations * Add cypress tests for new template category errors - Refactored how the template category tests work. These tests now use dynamically generated TC ids to ensure that when the tests are run in parallel with different cypress users there will not be any collisions or deletions of TCs being used by other tests. * Update package.json and lock * Add error banner UI tests for email branding - Set up scaffolding for the email branding list and management page - Added more data-testid attributes to email branding markup * Fix slow brain mistakes * Preserve branding form details when update fails * Preserve form data when updating existing Template Category * Preserve form data when creating TCs or email branding fails
- Loading branch information
Showing
16 changed files
with
540 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests_cypress/cypress/Notify/Admin/Pages/admin/EmailBrandingPage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
let Components = { | ||
BrandingSearchBox: () => cy.getByTestId('branding-search'), | ||
CreateBrandingButton: () => cy.getByTestId('create-branding'), | ||
} | ||
|
||
let Actions = { | ||
SearchForBranding: (name) => { | ||
Components.BrandingSearchBox().type(name); | ||
}, | ||
CreateBranding: () => { | ||
Components.CreateBrandingButton().click(); | ||
}, | ||
EditBrandingByName: (name) => { | ||
cy.get('a').contains(name).click(); | ||
}, | ||
EditBrandingById: (id) => { | ||
cy.getByTestId(`edit-branding-${id}`) | ||
} | ||
} | ||
|
||
let EmailBrandingPage = { | ||
Components, | ||
...Actions | ||
}; | ||
|
||
export default EmailBrandingPage; |
59 changes: 59 additions & 0 deletions
59
tests_cypress/cypress/Notify/Admin/Pages/admin/ManageEmailBrandingPage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
let Components = { | ||
UploadLogoButton: () => cy.getByTestId('upload-logo'), | ||
BrandName: () => cy.getByTestId('branding-name'), | ||
BrandText: () => cy.getByTestId('branding-text'), | ||
BrandAltTextEn: () => cy.getByTestId('branding-alt-text-en'), | ||
BrandAltTextFr: () => cy.getByTestId('branding-alt-text-fr'), | ||
BrandColour: () => cy.getByTestId('branding-colour'), | ||
CreateBrandingButton: () => cy.getByTestId('save-branding'), | ||
} | ||
|
||
let BrandingTypes = { | ||
BOTH_ENGLISH: "both_english", | ||
BOTH_FRENCH: "both_french", | ||
CUSTOM_LOGO: "custom_logo", | ||
CUSTOM_LOGO_WITH_BG_COLOUR: "custom_logo_with_background_colour", | ||
NO_BRANDING: "no_branding", | ||
} | ||
|
||
|
||
let Actions = { | ||
UploadLogo: () => { | ||
// TODO | ||
}, | ||
SetBrandName: (name) => { | ||
Components.BrandName().clear().type(name); | ||
}, | ||
SetBrandText: (text) => { | ||
Components.BrandText().clear().type(text); | ||
}, | ||
SetBrandAltTextEn: (text) => { | ||
Components.BrandAltTextEn().clear().type(text); | ||
}, | ||
SetBrandAltTextFr: (text) => { | ||
Components.BrandAltTextFr().clear().type(text); | ||
}, | ||
SetBrandColour: (colour) => { | ||
Components.BrandColour().clear().type(colour); | ||
}, | ||
SetBrandType: (type) => { | ||
cy.getByTestId(type).check(); | ||
}, | ||
SetOrganisation: (organisation) => { | ||
// Use no org for the time being until we have a way to fetch a list of | ||
// valid organisation IDs as the testid's for these radios are org ids | ||
// which will change between environments. | ||
cy.get('input[id="organisation-5"]').check(); | ||
}, | ||
Submit: () => { | ||
Components.CreateBrandingButton().click(); | ||
} | ||
} | ||
|
||
let ManageEmailBrandingPage = { | ||
Components, | ||
BrandingTypes, | ||
...Actions | ||
} | ||
|
||
export default ManageEmailBrandingPage; |
Oops, something went wrong.