Apply repository-wide ESLint auto-fix formatting pass

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
2026-03-08 12:11:57 +08:00
parent 7c48faaa3d
commit 847904c49b
172 changed files with 13629 additions and 9154 deletions

View File

@@ -3,94 +3,94 @@
// Authors:
// imacat.yang@dsp.im (imacat), 2026/03/05
import { loginWithFixtures } from '../support/intercept';
import { loginWithFixtures } from "../support/intercept";
describe('Account Management CRUD', () => {
describe("Account Management CRUD", () => {
beforeEach(() => {
loginWithFixtures();
cy.visit('/account-admin');
cy.wait('@getUsers');
cy.visit("/account-admin");
cy.wait("@getUsers");
});
it('shows Create New button', () => {
cy.get('#create_new_acct_btn').should('exist');
cy.get('#create_new_acct_btn').should('contain', 'Create New');
it("shows Create New button", () => {
cy.get("#create_new_acct_btn").should("exist");
cy.get("#create_new_acct_btn").should("contain", "Create New");
});
it('opens create new account modal', () => {
cy.get('#create_new_acct_btn').click();
cy.get('#modal_container').should('be.visible');
cy.get('#modal_account_edit_or_create_new').should('be.visible');
it("opens create new account modal", () => {
cy.get("#create_new_acct_btn").click();
cy.get("#modal_container").should("be.visible");
cy.get("#modal_account_edit_or_create_new").should("be.visible");
// Should show account, name, password fields
cy.get('#input_account_field').should('exist');
cy.get('#input_name_field').should('exist');
cy.get('#input_first_pwd').should('exist');
cy.get("#input_account_field").should("exist");
cy.get("#input_name_field").should("exist");
cy.get("#input_first_pwd").should("exist");
});
it('create account confirm is disabled when fields are empty', () => {
cy.get('#create_new_acct_btn').click();
cy.get('.confirm-btn').should('be.disabled');
it("create account confirm is disabled when fields are empty", () => {
cy.get("#create_new_acct_btn").click();
cy.get(".confirm-btn").should("be.disabled");
});
it('create account confirm enables when fields are filled', () => {
cy.get('#create_new_acct_btn').click();
cy.get('#input_account_field').type('newuser');
cy.get('#input_name_field').type('New User');
cy.get('#input_first_pwd').type('password1234');
cy.get('.confirm-btn').should('not.be.disabled');
it("create account confirm enables when fields are filled", () => {
cy.get("#create_new_acct_btn").click();
cy.get("#input_account_field").type("newuser");
cy.get("#input_name_field").type("New User");
cy.get("#input_first_pwd").type("password1234");
cy.get(".confirm-btn").should("not.be.disabled");
});
it('cancel button closes the modal', () => {
cy.get('#create_new_acct_btn').click();
cy.get('#modal_container').should('be.visible');
cy.get('.cancel-btn').click();
cy.get('#modal_container').should('not.exist');
it("cancel button closes the modal", () => {
cy.get("#create_new_acct_btn").click();
cy.get("#modal_container").should("be.visible");
cy.get(".cancel-btn").click();
cy.get("#modal_container").should("not.exist");
});
it('close (X) button closes the modal', () => {
cy.get('#create_new_acct_btn').click();
cy.get('#modal_container').should('be.visible');
it("close (X) button closes the modal", () => {
cy.get("#create_new_acct_btn").click();
cy.get("#modal_container").should("be.visible");
cy.get('img[alt="X"]').click();
cy.get('#modal_container').should('not.exist');
cy.get("#modal_container").should("not.exist");
});
it('double-click username opens account info modal', () => {
it("double-click username opens account info modal", () => {
// Double-click on the first account username
cy.get('.account-cell').first().dblclick();
cy.get('#modal_container').should('be.visible');
cy.get(".account-cell").first().dblclick();
cy.get("#modal_container").should("be.visible");
});
it('delete button opens delete confirmation modal', () => {
it("delete button opens delete confirmation modal", () => {
// Click the delete icon for a non-current user
cy.get('.delete-account').first().click();
cy.get('#modal_container').should('be.visible');
cy.get('#modal_delete_acct_alert').should('be.visible');
cy.get(".delete-account").first().click();
cy.get("#modal_container").should("be.visible");
cy.get("#modal_delete_acct_alert").should("be.visible");
});
it('delete modal has Yes and No buttons', () => {
cy.get('.delete-account').first().click();
cy.get('#calcel_delete_acct_btn').should('exist');
cy.get('#sure_to_delete_acct_btn').should('exist');
it("delete modal has Yes and No buttons", () => {
cy.get(".delete-account").first().click();
cy.get("#calcel_delete_acct_btn").should("exist");
cy.get("#sure_to_delete_acct_btn").should("exist");
});
it('delete modal No button closes the modal', () => {
cy.get('.delete-account').first().click();
cy.get('#calcel_delete_acct_btn').click();
cy.get('#modal_container').should('not.exist');
it("delete modal No button closes the modal", () => {
cy.get(".delete-account").first().click();
cy.get("#calcel_delete_acct_btn").click();
cy.get("#modal_container").should("not.exist");
});
it('shows checkboxes for Set as Admin and Activate in create modal', () => {
cy.get('#create_new_acct_btn').click();
cy.get('#account_create_checkboxes_section').should('be.visible');
cy.contains('Set as admin.').should('exist');
cy.contains('Activate now.').should('exist');
it("shows checkboxes for Set as Admin and Activate in create modal", () => {
cy.get("#create_new_acct_btn").click();
cy.get("#account_create_checkboxes_section").should("be.visible");
cy.contains("Set as admin.").should("exist");
cy.contains("Activate now.").should("exist");
});
it('search bar filters user list', () => {
it("search bar filters user list", () => {
// Search filters by username, not display name
cy.get('#input_search').type('user1');
cy.get("#input_search").type("user1");
cy.get('img[alt="search"]').click();
// Should only show user1 (Alice Wang)
cy.contains('user1').should('exist');
cy.contains("user1").should("exist");
});
});