28 lines
763 B
JavaScript
28 lines
763 B
JavaScript
import { loginWithFixtures } from '../../support/intercept';
|
|
|
|
const MODAL_TITLE_ACCOUNT_EDIT = 'Account Edit';
|
|
const MSG_ACCOUNT_EDITED = 'Saved';
|
|
|
|
describe('Edit an account', () => {
|
|
beforeEach(() => {
|
|
loginWithFixtures();
|
|
cy.visit('/account-admin');
|
|
cy.wait('@getUsers');
|
|
});
|
|
|
|
it('Edit an account; modify name and see saved message.', () => {
|
|
cy.get('.btn-edit').first().click();
|
|
cy.wait('@getUserDetail');
|
|
|
|
cy.contains('h1', MODAL_TITLE_ACCOUNT_EDIT).should('exist');
|
|
cy.get('#input_name_field').clear().type('Updated Name');
|
|
|
|
cy.contains('button', 'Confirm')
|
|
.should('be.visible')
|
|
.and('be.enabled')
|
|
.click();
|
|
cy.wait('@putUser');
|
|
cy.contains(MSG_ACCOUNT_EDITED).should('be.visible');
|
|
});
|
|
});
|