34 lines
948 B
JavaScript
34 lines
948 B
JavaScript
// The Lucia project.
|
|
// Copyright 2024-2026 DSP, inc. All rights reserved.
|
|
// Authors:
|
|
// cindy.chang@dsp.im (Cindy Chang), 2024/07/03
|
|
// imacat.yang@dsp.im (imacat), 2026/03/05
|
|
|
|
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');
|
|
});
|
|
});
|