Files
pleno-vue/tests/unit/self-serve-studio-refresh.spec.js
T
Jeppe Bundgaard b39b458f4f 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.
2026-04-13 09:13:27 +02:00

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()");
});
});