Skip to content

Commit c7974b5

Browse files
committed
Format
1 parent d5d4149 commit c7974b5

3 files changed

Lines changed: 13 additions & 15 deletions

File tree

src/pages/forms/court-order-ri/_e2e.spec.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,10 @@ test("Rhode Island Court Order", async ({ page }, testInfo) => {
222222
).toBeVisible();
223223
await expect(page.getByText("Residence street address: 100")).toBeVisible();
224224
await expect(page.getByText("Residence city: Providence")).toBeVisible();
225-
await expect(
226-
page.getByText("Mother’s first name: Mary"),
227-
).toBeVisible();
228-
await expect(
229-
page.getByText("Mother’s last name: Maiden"),
230-
).toBeVisible();
231-
await expect(
232-
page.getByText("Father’s first name: John"),
233-
).toBeVisible();
234-
await expect(
235-
page.getByText("Father’s last name: Smith"),
236-
).toBeVisible();
225+
await expect(page.getByText("Mother’s first name: Mary")).toBeVisible();
226+
await expect(page.getByText("Mother’s last name: Maiden")).toBeVisible();
227+
await expect(page.getByText("Father’s first name: John")).toBeVisible();
228+
await expect(page.getByText("Father’s last name: Smith")).toBeVisible();
237229
await expect(page.getByText("Occupation: Software Engineer")).toBeVisible();
238230
});
239231

src/utils/__tests__/joinParts.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ import { joinParts } from "../joinParts";
33

44
describe("joinParts", () => {
55
it("joins all parts with a comma", () => {
6-
expect(joinParts("Providence", "RI", "02903")).toBe("Providence, RI, 02903");
6+
expect(joinParts("Providence", "RI", "02903")).toBe(
7+
"Providence, RI, 02903",
8+
);
79
});
810

911
it("filters out undefined values", () => {
10-
expect(joinParts("Providence", undefined, "02903")).toBe("Providence, 02903");
12+
expect(joinParts("Providence", undefined, "02903")).toBe(
13+
"Providence, 02903",
14+
);
1115
});
1216

1317
it("returns undefined when all values are undefined", () => {

src/utils/joinParts.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export const joinParts = (...parts: (string | undefined)[]): string | undefined => {
1+
export const joinParts = (
2+
...parts: (string | undefined)[]
3+
): string | undefined => {
24
const result = parts.filter(Boolean).join(", ");
35
return result || undefined;
46
};

0 commit comments

Comments
 (0)