import { describe, expect, it } from "vitest"; import { cleanAddress } from "../format"; describe("cleanAddress", () => { it("drops Shopify's literal null city", () => { expect(cleanAddress("null ON, Canada")).toBe("ON, Canada"); }); it("drops parts that were only null", () => { expect(cleanAddress("null, Toronto, Canada")).toBe("Toronto, Canada"); }); it("leaves real addresses alone, including words containing null", () => { expect(cleanAddress("12 Nullarbor Rd, Waterloo ON N2V 1A1, Canada")).toBe("12 Nullarbor Rd, Waterloo ON N2V 1A1, Canada"); }); });