docbrown/cypress/integration/adminFlows/config/getStartedSection.js
Ridhwana ba5c97de50
RFC 50 - Remove old admin routes and related code (#13579)
* chore: remove current_admin routes file

* feat: move all the admin routes into the admin file

* chore: remove conditionals for the sidebar and tabbed navbar

* remove some more notes where we use the admin_restructure feature flag

* chore: amend the tests now that the old routes and the admin_restructure flag are removed

* chore: remove more references to the  admin_restructure flag

* chore: fix the tests

* chore: remove sidebar_spec

* chore: add slash back

* chore: comment it out for now whilst I try and figure out why its not passing
2021-05-03 16:03:38 +02:00

78 lines
2.4 KiB
JavaScript

describe('Get Started Section', () => {
beforeEach(() => {
cy.testSetup();
cy.fixture('users/adminUser.json').as('user');
cy.get('@user').then((user) => {
cy.loginUser(user);
});
});
describe('Community name setting', () => {
it('updates the community name', () => {
cy.get('@user').then(({ username }) => {
cy.visit('/admin/customization/config');
cy.findByTestId('getStartedSectionForm').as('getStartedSectionForm');
cy.get('@getStartedSectionForm')
.get('#community_name')
.clear()
.type('Awesome community');
cy.get('@getStartedSectionForm')
.findByPlaceholderText('Confirmation text')
.type(
`My username is @${username} and this action is 100% safe and appropriate.`,
);
cy.get('@getStartedSectionForm')
.findByText('Update Site Configuration')
.click();
cy.url().should('contains', '/admin/customization/config');
cy.findByText('Site configuration was successfully updated.').should(
'be.visible',
);
// Page reloaded so need to get a new reference to the form.
cy.findByTestId('getStartedSectionForm').as('getStartedSectionForm');
cy.get('#community_name').should('have.value', 'Awesome community');
});
});
it('updates the suggested tags', () => {
cy.get('@user').then(({ username }) => {
cy.visit('/admin/customization/config');
cy.findByTestId('getStartedSectionForm').as('getStartedSectionForm');
cy.get('@getStartedSectionForm')
.get('#suggested_tags')
.clear()
.type('much tag, so wow');
cy.get('@getStartedSectionForm')
.findByPlaceholderText('Confirmation text')
.type(
`My username is @${username} and this action is 100% safe and appropriate.`,
);
cy.get('@getStartedSectionForm')
.findByText('Update Site Configuration')
.click();
cy.url().should('contains', '/admin/customization/config');
cy.findByText('Site configuration was successfully updated.').should(
'be.visible',
);
// Page reloaded so need to get a new reference to the form.
cy.findByTestId('getStartedSectionForm').as('getStartedSectionForm');
cy.get('#suggested_tags').should('have.value', 'much tag,so wow');
});
});
});
});