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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user