Skip to content

Commit

Permalink
fix(tests): correct utils & tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksanderNekr committed Jun 21, 2024
1 parent 632fd8c commit 5c4549a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("utils", () => {

it("should handle null and undefined gracefully", () => {
const result = cleanString(null);
expect(result).toBe(null);
expect(result).toBe("");
});
});

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export const div = (a: number, b: number) => {
return (a - a % b) / b;
};

export const cleanString = (s: string | null) => s?.trim()?.replaceAll(/\s{2,}/g, " ") ?? null;
export const cleanString = (s: string | null) => s?.trim()?.replaceAll(/\s{2,}/g, " ") ?? "";

0 comments on commit 5c4549a

Please sign in to comment.