Apply repository-wide ESLint auto-fix formatting pass
Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
// Authors:
|
||||
// imacat.yang@dsp.im (imacat), 2026/03/05
|
||||
|
||||
import { describe, it, expect, beforeEach } from 'vitest';
|
||||
import { setActivePinia, createPinia } from 'pinia';
|
||||
import { usePageAdminStore } from '@/stores/pageAdmin';
|
||||
import { describe, it, expect, beforeEach } from "vitest";
|
||||
import { setActivePinia, createPinia } from "pinia";
|
||||
import { usePageAdminStore } from "@/stores/pageAdmin";
|
||||
|
||||
describe('pageAdminStore', () => {
|
||||
describe("pageAdminStore", () => {
|
||||
let store;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -15,81 +15,81 @@ describe('pageAdminStore', () => {
|
||||
store = usePageAdminStore();
|
||||
});
|
||||
|
||||
it('has correct default state', () => {
|
||||
expect(store.activePage).toBe('MAP');
|
||||
expect(store.previousPage).toBe('MAP');
|
||||
expect(store.pendingActivePage).toBe('FILES');
|
||||
it("has correct default state", () => {
|
||||
expect(store.activePage).toBe("MAP");
|
||||
expect(store.previousPage).toBe("MAP");
|
||||
expect(store.pendingActivePage).toBe("FILES");
|
||||
expect(store.isPagePending).toBe(false);
|
||||
expect(store.shouldKeepPreviousPage).toBe(false);
|
||||
expect(store.currentMapFile).toBe('');
|
||||
expect(store.currentMapFile).toBe("");
|
||||
});
|
||||
|
||||
it('setActivePage converts page name', () => {
|
||||
store.setActivePage('CheckConformance');
|
||||
expect(store.activePage).toBe('CONFORMANCE');
|
||||
it("setActivePage converts page name", () => {
|
||||
store.setActivePage("CheckConformance");
|
||||
expect(store.activePage).toBe("CONFORMANCE");
|
||||
});
|
||||
|
||||
it('setPreviousPage converts page name', () => {
|
||||
store.setPreviousPage('CheckPerformance');
|
||||
expect(store.previousPage).toBe('PERFORMANCE');
|
||||
it("setPreviousPage converts page name", () => {
|
||||
store.setPreviousPage("CheckPerformance");
|
||||
expect(store.previousPage).toBe("PERFORMANCE");
|
||||
});
|
||||
|
||||
it('setPreviousPageUsingActivePage copies activePage to previousPage', () => {
|
||||
store.setActivePage('CONFORMANCE');
|
||||
it("setPreviousPageUsingActivePage copies activePage to previousPage", () => {
|
||||
store.setActivePage("CONFORMANCE");
|
||||
store.setPreviousPageUsingActivePage();
|
||||
expect(store.previousPage).toBe('CONFORMANCE');
|
||||
expect(store.previousPage).toBe("CONFORMANCE");
|
||||
});
|
||||
|
||||
it('setIsPagePendingBoolean sets boolean', () => {
|
||||
it("setIsPagePendingBoolean sets boolean", () => {
|
||||
store.setIsPagePendingBoolean(true);
|
||||
expect(store.isPagePending).toBe(true);
|
||||
});
|
||||
|
||||
it('setPendingActivePage converts and sets page', () => {
|
||||
store.setPendingActivePage('CheckMap');
|
||||
expect(store.pendingActivePage).toBe('MAP');
|
||||
it("setPendingActivePage converts and sets page", () => {
|
||||
store.setPendingActivePage("CheckMap");
|
||||
expect(store.pendingActivePage).toBe("MAP");
|
||||
});
|
||||
|
||||
it('copyPendingPageToActivePage transfers value', () => {
|
||||
store.setPendingActivePage('CheckConformance');
|
||||
it("copyPendingPageToActivePage transfers value", () => {
|
||||
store.setPendingActivePage("CheckConformance");
|
||||
store.copyPendingPageToActivePage();
|
||||
expect(store.activePage).toBe('CONFORMANCE');
|
||||
expect(store.activePage).toBe("CONFORMANCE");
|
||||
});
|
||||
|
||||
it('clearPendingActivePage resets to empty', () => {
|
||||
store.setPendingActivePage('CheckMap');
|
||||
it("clearPendingActivePage resets to empty", () => {
|
||||
store.setPendingActivePage("CheckMap");
|
||||
store.clearPendingActivePage();
|
||||
expect(store.pendingActivePage).toBe('');
|
||||
expect(store.pendingActivePage).toBe("");
|
||||
});
|
||||
|
||||
it('keepPreviousPage restores previous page', () => {
|
||||
store.setPreviousPage('CONFORMANCE');
|
||||
store.setActivePage('PERFORMANCE');
|
||||
it("keepPreviousPage restores previous page", () => {
|
||||
store.setPreviousPage("CONFORMANCE");
|
||||
store.setActivePage("PERFORMANCE");
|
||||
store.keepPreviousPage();
|
||||
expect(store.activePage).toBe('CONFORMANCE');
|
||||
expect(store.activePage).toBe("CONFORMANCE");
|
||||
expect(store.shouldKeepPreviousPage).toBe(true);
|
||||
});
|
||||
|
||||
it('clearShouldKeepPreviousPageBoolean resets flag', () => {
|
||||
it("clearShouldKeepPreviousPageBoolean resets flag", () => {
|
||||
store.keepPreviousPage();
|
||||
store.clearShouldKeepPreviousPageBoolean();
|
||||
expect(store.shouldKeepPreviousPage).toBe(false);
|
||||
});
|
||||
|
||||
it('setCurrentMapFile sets file name', () => {
|
||||
store.setCurrentMapFile('test.csv');
|
||||
expect(store.currentMapFile).toBe('test.csv');
|
||||
it("setCurrentMapFile sets file name", () => {
|
||||
store.setCurrentMapFile("test.csv");
|
||||
expect(store.currentMapFile).toBe("test.csv");
|
||||
});
|
||||
|
||||
it('setActivePageComputedByRoute extracts route name', () => {
|
||||
const routeMatched = [{ name: 'CheckMap' }];
|
||||
it("setActivePageComputedByRoute extracts route name", () => {
|
||||
const routeMatched = [{ name: "CheckMap" }];
|
||||
store.setActivePageComputedByRoute(routeMatched);
|
||||
expect(store.activePageComputedByRoute).toBe('MAP');
|
||||
expect(store.activePageComputedByRoute).toBe("MAP");
|
||||
});
|
||||
|
||||
it('setActivePageComputedByRoute handles empty array', () => {
|
||||
it("setActivePageComputedByRoute handles empty array", () => {
|
||||
store.setActivePageComputedByRoute([]);
|
||||
// Should not change default value
|
||||
expect(store.activePageComputedByRoute).toBe('MAP');
|
||||
expect(store.activePageComputedByRoute).toBe("MAP");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user