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:
Jeppe Bundgaard
2026-04-13 09:13:27 +02:00
parent f040614f46
commit b39b458f4f
149 changed files with 7212 additions and 6178 deletions
+25 -25
View File
@@ -94,9 +94,7 @@ describe("SelfServeTryModal", () => {
mocks.getVehicleTypeOptions.mockReset();
mocks.evaluateCondition.mockReset();
mocks.getLanes.mockResolvedValue([
{ id: 3, department: 9, name: "Lane 3" },
]);
mocks.getLanes.mockResolvedValue([{ id: 3, department: 9, name: "Lane 3" }]);
mocks.getVehicleTypeOptions.mockResolvedValue([
{ id: 0, name: "Ukendt" },
{ id: 2, name: "Truck" },
@@ -113,18 +111,19 @@ describe("SelfServeTryModal", () => {
mocks.evaluateCondition.mockReturnValue(true);
});
const mountModal = () => mountWithApp(SelfServeTryModal, {
props: {
departmentId: 9,
laneId: 3,
},
global: {
stubs: {
SelfServeQuestionCards: true,
SelfServeTaskList: true,
const mountModal = () =>
mountWithApp(SelfServeTryModal, {
props: {
departmentId: 9,
laneId: 3,
},
},
});
global: {
stubs: {
SelfServeQuestionCards: true,
SelfServeTaskList: true,
},
},
});
it("keeps clear answers enabled for valid lane/reg even when no visible answers exist", async () => {
const wrapper = mountModal();
@@ -162,7 +161,8 @@ describe("SelfServeTryModal", () => {
SelfServeQuestionCards: {
props: ["visibleQuestions"],
emits: ["answer-question"],
template: "<button data-testid='emit-card-answer' @click=\"$emit('answer-question', visibleQuestions[0]?.id, true)\">answer</button>",
template:
"<button data-testid='emit-card-answer' @click=\"$emit('answer-question', visibleQuestions[0]?.id, true)\">answer</button>",
},
SelfServeTaskList: true,
},
@@ -283,7 +283,8 @@ describe("SelfServeTryModal", () => {
stubs: {
SelfServeQuestionCards: {
props: ["visibleQuestions"],
template: "<div data-testid='question-cards-probe'>{{ visibleQuestions.map(q => q.question).join('|') }}</div>",
template:
"<div data-testid='question-cards-probe'>{{ visibleQuestions.map(q => q.question).join('|') }}</div>",
},
SelfServeTaskList: true,
},
@@ -313,7 +314,8 @@ describe("SelfServeTryModal", () => {
stubs: {
SelfServeQuestionCards: {
props: ["visibleQuestions"],
template: "<div data-testid='question-cards-probe'>{{ visibleQuestions.map(q => q.question).join('|') }}</div>",
template:
"<div data-testid='question-cards-probe'>{{ visibleQuestions.map(q => q.question).join('|') }}</div>",
},
SelfServeTaskList: true,
},
@@ -327,9 +329,7 @@ describe("SelfServeTryModal", () => {
});
it("keeps condition-true unanswered follow-up visible when server visible list is stale", async () => {
mocks.visibleQuestions.value = [
{ id: 11, question: "Question 11", order_priority: 1, condition_id: null },
];
mocks.visibleQuestions.value = [{ id: 11, question: "Question 11", order_priority: 1, condition_id: null }];
mocks.questions.value = [
{ id: 11, question: "Question 11", order_priority: 1, condition_id: null },
{ id: 12, question: "Follow-up question", order_priority: 2, condition_id: 100 },
@@ -346,7 +346,8 @@ describe("SelfServeTryModal", () => {
stubs: {
SelfServeQuestionCards: {
props: ["visibleQuestions"],
template: "<div data-testid='question-cards-probe'>{{ visibleQuestions.map(q => q.question).join('|') }}</div>",
template:
"<div data-testid='question-cards-probe'>{{ visibleQuestions.map(q => q.question).join('|') }}</div>",
},
SelfServeTaskList: true,
},
@@ -359,9 +360,7 @@ describe("SelfServeTryModal", () => {
});
it("does not add follow-up questions when their condition is false", async () => {
mocks.visibleQuestions.value = [
{ id: 11, question: "Question 11", order_priority: 1, condition_id: null },
];
mocks.visibleQuestions.value = [{ id: 11, question: "Question 11", order_priority: 1, condition_id: null }];
mocks.questions.value = [
{ id: 11, question: "Question 11", order_priority: 1, condition_id: null },
{ id: 12, question: "Follow-up question", order_priority: 2, condition_id: 100 },
@@ -378,7 +377,8 @@ describe("SelfServeTryModal", () => {
stubs: {
SelfServeQuestionCards: {
props: ["visibleQuestions"],
template: "<div data-testid='question-cards-probe'>{{ visibleQuestions.map(q => q.question).join('|') }}</div>",
template:
"<div data-testid='question-cards-probe'>{{ visibleQuestions.map(q => q.question).join('|') }}</div>",
},
SelfServeTaskList: true,
},