- 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.
24 lines
1.1 KiB
JavaScript
24 lines
1.1 KiB
JavaScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
const readSource = (relativePath) => readFileSync(join(process.cwd(), relativePath), "utf8");
|
|
|
|
describe("self-serve studio refresh behavior", () => {
|
|
it("clears ObjectsGlobal cache before loading studio lists", () => {
|
|
const studioSource = readSource(
|
|
"src/views/dashboards/departmentDashboard/modules/self-serve/DepartmentSelfServeStudio.vue"
|
|
);
|
|
|
|
expect(studioSource).toContain(
|
|
'import { ObjectsGlobal } from "@/components/session/token/SessionUser/Objects/ObjectsGlobal.vue";'
|
|
);
|
|
expect(studioSource).toContain("const loadStudioData = async () => {");
|
|
expect(studioSource).toContain("ObjectsGlobal.clearCache();");
|
|
expect(studioSource).toContain("SessionUser.objects.self_serve_questions.get.all()");
|
|
expect(studioSource).toContain("SessionUser.objects.self_serve_conditions.get.all()");
|
|
expect(studioSource).toContain("SessionUser.objects.self_serve_condition_rules.get.all()");
|
|
expect(studioSource).toContain("SessionUser.objects.self_serve_tasks.get.all()");
|
|
});
|
|
});
|