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,113 +3,113 @@
// Authors:
// imacat.yang@dsp.im (imacat), 2026/03/05
import { loginWithFixtures } from '../support/intercept';
import { loginWithFixtures } from "../support/intercept";
describe('SweetAlert2 Modals', () => {
describe('File Context Menu - Rename', () => {
describe("SweetAlert2 Modals", () => {
describe("File Context Menu - Rename", () => {
beforeEach(() => {
loginWithFixtures();
cy.visit('/files');
cy.wait('@getFiles');
cy.visit("/files");
cy.wait("@getFiles");
});
it('right-click on table row shows context menu with Rename', () => {
cy.get('table tbody tr').first().rightclick();
cy.contains('Rename').should('be.visible');
it("right-click on table row shows context menu with Rename", () => {
cy.get("table tbody tr").first().rightclick();
cy.contains("Rename").should("be.visible");
});
it('right-click context menu shows Download option', () => {
cy.get('table tbody tr').first().rightclick();
cy.contains('Download').should('be.visible');
it("right-click context menu shows Download option", () => {
cy.get("table tbody tr").first().rightclick();
cy.contains("Download").should("be.visible");
});
it('right-click context menu shows Delete option', () => {
cy.get('table tbody tr').first().rightclick();
cy.contains('Delete').should('be.visible');
it("right-click context menu shows Delete option", () => {
cy.get("table tbody tr").first().rightclick();
cy.contains("Delete").should("be.visible");
});
it('clicking Rename opens SweetAlert rename dialog', () => {
cy.get('table tbody tr').first().rightclick();
cy.contains('Rename').click();
it("clicking Rename opens SweetAlert rename dialog", () => {
cy.get("table tbody tr").first().rightclick();
cy.contains("Rename").click();
// SweetAlert popup should appear with RENAME title
cy.get('.swal2-popup').should('be.visible');
cy.get('.swal2-title').should('contain', 'RENAME');
cy.get('.swal2-input').should('exist');
cy.get(".swal2-popup").should("be.visible");
cy.get(".swal2-title").should("contain", "RENAME");
cy.get(".swal2-input").should("exist");
});
it('rename dialog has pre-filled file name', () => {
cy.get('table tbody tr').first().rightclick();
cy.contains('Rename').click();
cy.get('.swal2-input').should('not.have.value', '');
it("rename dialog has pre-filled file name", () => {
cy.get("table tbody tr").first().rightclick();
cy.contains("Rename").click();
cy.get(".swal2-input").should("not.have.value", "");
});
it('rename dialog can be cancelled', () => {
cy.get('table tbody tr').first().rightclick();
cy.contains('Rename').click();
cy.get('.swal2-popup').should('be.visible');
cy.get('.swal2-cancel').click();
cy.get('.swal2-popup').should('not.exist');
it("rename dialog can be cancelled", () => {
cy.get("table tbody tr").first().rightclick();
cy.contains("Rename").click();
cy.get(".swal2-popup").should("be.visible");
cy.get(".swal2-cancel").click();
cy.get(".swal2-popup").should("not.exist");
});
it('clicking Delete opens SweetAlert delete confirmation', () => {
cy.get('table tbody tr').first().rightclick();
cy.contains('Delete').click();
it("clicking Delete opens SweetAlert delete confirmation", () => {
cy.get("table tbody tr").first().rightclick();
cy.contains("Delete").click();
// SweetAlert popup should appear with CONFIRM DELETION
cy.get('.swal2-popup').should('be.visible');
cy.get('.swal2-title').should('contain', 'CONFIRM DELETION');
cy.get(".swal2-popup").should("be.visible");
cy.get(".swal2-title").should("contain", "CONFIRM DELETION");
});
it('delete confirmation shows file name', () => {
cy.get('table tbody tr').first().rightclick();
cy.contains('Delete').click();
cy.get('.swal2-popup').should('be.visible');
cy.get('.swal2-html-container').should('contain', 'delete');
it("delete confirmation shows file name", () => {
cy.get("table tbody tr").first().rightclick();
cy.contains("Delete").click();
cy.get(".swal2-popup").should("be.visible");
cy.get(".swal2-html-container").should("contain", "delete");
});
it('delete confirmation can be cancelled', () => {
cy.get('table tbody tr').first().rightclick();
cy.contains('Delete').click();
cy.get('.swal2-popup').should('be.visible');
cy.get('.swal2-cancel').click();
cy.get('.swal2-popup').should('not.exist');
it("delete confirmation can be cancelled", () => {
cy.get("table tbody tr").first().rightclick();
cy.contains("Delete").click();
cy.get(".swal2-popup").should("be.visible");
cy.get(".swal2-cancel").click();
cy.get(".swal2-popup").should("not.exist");
});
});
describe('File Context Menu on Grid View', () => {
describe("File Context Menu on Grid View", () => {
beforeEach(() => {
loginWithFixtures();
cy.visit('/files');
cy.wait('@getFiles');
cy.visit("/files");
cy.wait("@getFiles");
// Switch to grid view
cy.get('svg').parent('li.cursor-pointer').last().click();
cy.get("svg").parent("li.cursor-pointer").last().click();
});
it('right-click on grid card shows context menu', () => {
cy.get('li[title]').first().rightclick();
cy.contains('Rename').should('be.visible');
cy.contains('Delete').should('be.visible');
it("right-click on grid card shows context menu", () => {
cy.get("li[title]").first().rightclick();
cy.contains("Rename").should("be.visible");
cy.contains("Delete").should("be.visible");
});
it('grid card rename opens SweetAlert dialog', () => {
cy.get('li[title]').first().rightclick();
cy.contains('Rename').click();
cy.get('.swal2-popup').should('be.visible');
cy.get('.swal2-title').should('contain', 'RENAME');
it("grid card rename opens SweetAlert dialog", () => {
cy.get("li[title]").first().rightclick();
cy.contains("Rename").click();
cy.get(".swal2-popup").should("be.visible");
cy.get(".swal2-title").should("contain", "RENAME");
});
});
describe('Account Delete Confirmation', () => {
describe("Account Delete Confirmation", () => {
beforeEach(() => {
loginWithFixtures();
cy.visit('/account-admin');
cy.wait('@getUsers');
cy.visit("/account-admin");
cy.wait("@getUsers");
});
it('delete confirmation Yes button triggers delete API', () => {
cy.get('.delete-account').first().click();
cy.get('#modal_container').should('be.visible');
cy.get('#sure_to_delete_acct_btn').click();
cy.wait('@deleteUser');
it("delete confirmation Yes button triggers delete API", () => {
cy.get(".delete-account").first().click();
cy.get("#modal_container").should("be.visible");
cy.get("#sure_to_delete_acct_btn").click();
cy.wait("@deleteUser");
// Modal should close after deletion
});
});