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,92 +3,92 @@
// Authors:
// imacat.yang@dsp.im (imacat), 2026/03/05
import { loginWithFixtures } from '../support/intercept';
import { loginWithFixtures } from "../support/intercept";
describe('Edge Cases', () => {
describe('Empty states', () => {
it('files page handles empty file list', () => {
describe("Edge Cases", () => {
describe("Empty states", () => {
it("files page handles empty file list", () => {
loginWithFixtures();
// Override files intercept with empty array
cy.intercept('GET', '/api/files', {
cy.intercept("GET", "/api/files", {
statusCode: 200,
body: [],
}).as('getEmptyFiles');
cy.visit('/files');
cy.wait('@getEmptyFiles');
}).as("getEmptyFiles");
cy.visit("/files");
cy.wait("@getEmptyFiles");
// Table should exist but have no file data
cy.get('table').should('exist');
cy.contains('sample-process.xes').should('not.exist');
cy.get("table").should("exist");
cy.contains("sample-process.xes").should("not.exist");
});
it('account admin handles empty user list', () => {
it("account admin handles empty user list", () => {
loginWithFixtures();
cy.intercept('GET', '/api/users', {
cy.intercept("GET", "/api/users", {
statusCode: 200,
body: [],
}).as('getEmptyUsers');
cy.visit('/account-admin');
cy.wait('@getEmptyUsers');
}).as("getEmptyUsers");
cy.visit("/account-admin");
cy.wait("@getEmptyUsers");
// Create New button should still work
cy.get('#create_new_acct_btn').should('exist');
cy.get("#create_new_acct_btn").should("exist");
});
});
describe('Authentication guard', () => {
it('unauthenticated user is redirected to login', () => {
describe("Authentication guard", () => {
it("unauthenticated user is redirected to login", () => {
// No loginWithFixtures - not logged in
cy.visit('/files');
cy.url().should('include', '/login');
cy.visit("/files");
cy.url().should("include", "/login");
});
it('unauthenticated user cannot access account-admin', () => {
cy.visit('/account-admin');
cy.url().should('include', '/login');
it("unauthenticated user cannot access account-admin", () => {
cy.visit("/account-admin");
cy.url().should("include", "/login");
});
it('unauthenticated user cannot access my-account', () => {
cy.visit('/my-account');
cy.url().should('include', '/login');
it("unauthenticated user cannot access my-account", () => {
cy.visit("/my-account");
cy.url().should("include", "/login");
});
});
describe('Login validation', () => {
it('shows error on failed login', () => {
cy.intercept('POST', '/api/oauth/token', {
describe("Login validation", () => {
it("shows error on failed login", () => {
cy.intercept("POST", "/api/oauth/token", {
statusCode: 401,
body: { detail: 'Invalid credentials' },
}).as('failedLogin');
cy.visit('/login');
cy.get('#account').type('wrong');
cy.get('#password').type('wrong');
cy.get('form').submit();
cy.wait('@failedLogin');
body: { detail: "Invalid credentials" },
}).as("failedLogin");
cy.visit("/login");
cy.get("#account").type("wrong");
cy.get("#password").type("wrong");
cy.get("form").submit();
cy.wait("@failedLogin");
// Should stay on login page
cy.url().should('include', '/login');
cy.url().should("include", "/login");
});
});
describe('Account creation validation', () => {
describe("Account creation validation", () => {
beforeEach(() => {
loginWithFixtures();
cy.visit('/account-admin');
cy.wait('@getUsers');
cy.get('#create_new_acct_btn').click();
cy.visit("/account-admin");
cy.wait("@getUsers");
cy.get("#create_new_acct_btn").click();
});
it('confirm stays disabled with only account field filled', () => {
cy.get('#input_account_field').type('newuser');
cy.get('.confirm-btn').should('be.disabled');
it("confirm stays disabled with only account field filled", () => {
cy.get("#input_account_field").type("newuser");
cy.get(".confirm-btn").should("be.disabled");
});
it('confirm stays disabled with only name field filled', () => {
cy.get('#input_name_field').type('New User');
cy.get('.confirm-btn').should('be.disabled');
it("confirm stays disabled with only name field filled", () => {
cy.get("#input_name_field").type("New User");
cy.get(".confirm-btn").should("be.disabled");
});
it('confirm stays disabled with only password field filled', () => {
cy.get('#input_first_pwd').type('password1234');
cy.get('.confirm-btn').should('be.disabled');
it("confirm stays disabled with only password field filled", () => {
cy.get("#input_first_pwd").type("password1234");
cy.get(".confirm-btn").should("be.disabled");
});
});
});