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
+45 -20
View File
@@ -39,10 +39,15 @@ test.describe("POS mobile card payments", () => {
await page.getByTestId("pos-mobile-direct-card-payment").click();
await expect(page.getByTestId("pos-mobile-customer-popup")).toBeHidden({ timeout: 10_000 });
await expect.poll(async () => {
const snapshot = await getStoredPosSnapshot(page);
return snapshot?.metadata?.customerId ?? null;
}, { timeout: 10_000 }).toBe(CARD_CUSTOMER_ID);
await expect
.poll(
async () => {
const snapshot = await getStoredPosSnapshot(page);
return snapshot?.metadata?.customerId ?? null;
},
{ timeout: 10_000 }
)
.toBe(CARD_CUSTOMER_ID);
const snapshot = await getStoredPosSnapshot(page);
expect(snapshot?.vehicles?.vehicle_1?.reg).toBe("ZZ00000");
@@ -83,10 +88,15 @@ test.describe("POS mobile card payments", () => {
await expect.poll(() => fixture.requestCounters.paymentIntentCapture, { timeout: 10_000 }).toBe(1);
await expect.poll(() => fixture.requestCounters.markAsCompleted, { timeout: 10_000 }).toBe(1);
await expect.poll(() => {
const currentUrl = new URL(page.url());
return currentUrl.searchParams.get("step");
}, { timeout: 12_000 }).toBe("1");
await expect
.poll(
() => {
const currentUrl = new URL(page.url());
return currentUrl.searchParams.get("step");
},
{ timeout: 12_000 }
)
.toBe("1");
await expect(page.getByTestId("pos-mobile-next-step")).toBeVisible({ timeout: 10_000 });
});
@@ -234,10 +244,15 @@ test.describe("POS mobile card payments", () => {
await page.getByTestId("pos-stripe-capture-intent").click();
await expect.poll(() => fixture.requestCounters.paymentIntentCapture, { timeout: 10_000 }).toBe(1);
await expect.poll(() => fixture.requestCounters.markAsCompleted, { timeout: 10_000 }).toBe(1);
await expect.poll(() => {
const currentUrl = new URL(page.url());
return currentUrl.searchParams.get("step");
}, { timeout: 12_000 }).toBe("1");
await expect
.poll(
() => {
const currentUrl = new URL(page.url());
return currentUrl.searchParams.get("step");
},
{ timeout: 12_000 }
)
.toBe("1");
await expect(page.getByTestId("pos-mobile-next-step")).toBeVisible({ timeout: 10_000 });
});
@@ -315,10 +330,15 @@ test.describe("POS mobile card payments", () => {
await expect.poll(() => fixture.requestCounters.markAsCompleted, { timeout: 10_000 }).toBe(1);
expect(fixture.requestCounters.paymentIntentCreate).toBe(0);
expect(fixture.requestCounters.paymentIntentCapture).toBe(0);
await expect.poll(() => {
const currentUrl = new URL(page.url());
return currentUrl.searchParams.get("step");
}, { timeout: 12_000 }).toBe("1");
await expect
.poll(
() => {
const currentUrl = new URL(page.url());
return currentUrl.searchParams.get("step");
},
{ timeout: 12_000 }
)
.toBe("1");
});
test("returning to step 2 and re-entering step 3 does not duplicate order items", async ({ page }) => {
@@ -435,10 +455,15 @@ test.describe("POS mobile card payments", () => {
await expect(page.getByTestId("pos-mobile-step-2")).toBeVisible({ timeout: 10_000 });
await page.getByTestId("pos-mobile-next-step").click();
await expect.poll(() => fixture.requestCounters.orderItemsPost, { timeout: 10_000 }).toBe(1);
await expect.poll(() => {
const currentUrl = new URL(page.url());
return currentUrl.searchParams.get("step");
}, { timeout: 12_000 }).toBe("1");
await expect
.poll(
() => {
const currentUrl = new URL(page.url());
return currentUrl.searchParams.get("step");
},
{ timeout: 12_000 }
)
.toBe("1");
expect(fixture.requestCounters.markAsCompleted).toBe(0);
await expect(page.getByTestId("pos-mobile-step-3")).toHaveCount(0);