Add .prettierrc.json and refactor test files for improved formatting consistency:
- Introduced `.prettierrc.json` to enforce consistent code formatting across the project. - Updated unit and e2e test files to address formatting issues, improve readability, and ensure alignment with the new Prettier configuration.
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const root = process.cwd();
|
||||
const source = readFileSync(
|
||||
join(root, 'src/components/models/navigation/items/NavigationMenuItemsAdmin.vue'),
|
||||
'utf8'
|
||||
).replace(/\r\n/g, '\n');
|
||||
join(root, "src/components/models/navigation/items/NavigationMenuItemsAdmin.vue"),
|
||||
"utf8"
|
||||
).replace(/\r\n/g, "\n");
|
||||
|
||||
describe('NavigationMenuItemsAdmin contract', () => {
|
||||
it('derives department id from synced route context without router import', () => {
|
||||
describe("NavigationMenuItemsAdmin contract", () => {
|
||||
it("derives department id from synced route context without router import", () => {
|
||||
expect(source).not.toContain('import { router } from "@/router.js";');
|
||||
expect(source).toContain('const routeContext = ref(');
|
||||
expect(source).toContain('const syncAdminNavigationRoute = (route: any) => {');
|
||||
expect(source).toContain('const currentRoute = routeContext.value;');
|
||||
expect(source).toContain('currentRoute?.params?.departmentId');
|
||||
expect(source).toContain('currentRoute?.path?.match(/^\\/admin\\/(\\d+)(?:\\/|$)/)');
|
||||
expect(source).toContain("const routeContext = ref(");
|
||||
expect(source).toContain("const syncAdminNavigationRoute = (route: any) => {");
|
||||
expect(source).toContain("const currentRoute = routeContext.value;");
|
||||
expect(source).toContain("currentRoute?.params?.departmentId");
|
||||
expect(source).toContain("currentRoute?.path?.match(/^\\/admin\\/(\\d+)(?:\\/|$)/)");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user