Skip to content

Commit

Permalink
test(pages-components): add test for address not writing errors to co…
Browse files Browse the repository at this point in the history
…nsole

when multiple separators are used on a line
  • Loading branch information
hbendev committed Jan 13, 2025
1 parent a9b06a4 commit 46fb5b6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/pages-components/src/components/address/address.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,23 @@ describe("Address", () => {

expect(cityEl && regionEl).toBeFalsy();
});

it("renders custom lines with separators without warnings", () => {
const originalError = console.error;
console.error = vi.fn();

render(
<Address
address={address}
lines={[
["line1", ",", "line2"],
["city", ",", "region", ",", "postalCode"],
]}
/>
);

expect(console.error).not.toHaveBeenCalled();

console.error = originalError;
});
});

0 comments on commit 46fb5b6

Please sign in to comment.