test(web): cover prune-fields, labels, format-date, delete-in-use dialog (#67)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { expect, test } from "vitest";
|
||||
|
||||
import { formatDate } from "./format-date";
|
||||
|
||||
test("formats a date-only string in the locale without a timezone day-shift", () => {
|
||||
expect(formatDate("1962-04-03", "en")).toBe("Apr 3, 1962");
|
||||
});
|
||||
|
||||
test("returns the em-dash placeholder for null", () => {
|
||||
expect(formatDate(null, "en")).toBe("—");
|
||||
});
|
||||
|
||||
test("returns an unparseable string unchanged", () => {
|
||||
expect(formatDate("not-a-date", "en")).toBe("not-a-date");
|
||||
});
|
||||
|
||||
test("stringifies a non-string, non-null value", () => {
|
||||
expect(formatDate(42, "en")).toBe("42");
|
||||
});
|
||||
Reference in New Issue
Block a user