Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
MM-20339 add E2E for "Can change Enable Custom Branding setting" (#4391)
Browse files Browse the repository at this point in the history
* MM-20339 add E2E for "Can change Enable Custom Branding setting"

* fix current issues

* make sure test have right initial setup

* fix the indentation

* Fixing wrongly added spaces on resolve conflict
  • Loading branch information
0xVolodya authored and saturninoabril committed Dec 16, 2019
1 parent e2100fe commit 86c5438
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('Customization', () => {
},
TeamSettings: {
SiteName: config.TeamSettings.SiteName,
EnableCustomBrand: config.TeamSettings.EnableCustomBrand,
},
NativeAppSettings: {
AppDownloadLink: config.NativeAppSettings.AppDownloadLink,
Expand Down Expand Up @@ -305,4 +306,41 @@ describe('Customization', () => {
expect(config.SupportSettings.TermsOfServiceLink).to.eq(newValue);
});
});

it('SC20339 - Can change Enable Custom Branding setting', () => {
// # Make sure necessary field is false
cy.apiUpdateConfigBasic({TeamSettings: {EnableCustomBrand: false}});
cy.reload();

cy.findByTestId('TeamSettings.EnableCustomBrand').should('be.visible').within(() => {
// * Verify that setting is visible and matches text content
cy.get('label:first').should('be.visible').and('have.text', 'Enable Custom Branding: ');

// * Verify that help setting is visible and matches text content
const content = 'Enable custom branding to show an image of your choice, uploaded below, and some help text, written below, on the login page.';
cy.get('.help-text').should('be.visible').and('have.text', content);

// # Set Enable Custom Branding to true
cy.findByTestId('TeamSettings.EnableCustomBrandtrue').check();
});

// # Click Save button
cy.get('#saveSetting').click();

// * Verify that the value is save, directly via REST API
cy.apiGetConfig().then((response) => {
expect(response.body.TeamSettings.EnableCustomBrand).to.equal(true);
});

// # Set Enable Custom Branding to false
cy.findByTestId('TeamSettings.EnableCustomBrandfalse').check();

// # Click Save button
cy.get('#saveSetting').click();

// * Verify that the value is save, directly via REST API
cy.apiGetConfig().then((response) => {
expect(response.body.TeamSettings.EnableCustomBrand).to.equal(false);
});
});
});

0 comments on commit 86c5438

Please sign in to comment.