time tests
This commit is contained in:
parent
b78ccb801f
commit
d9e7543238
1 changed files with 31 additions and 0 deletions
31
tests/utils/time.test.ts
Normal file
31
tests/utils/time.test.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { showDate } from "../../src/utils/time";
|
||||
|
||||
describe("Date with correct timezone", () => {
|
||||
const map: Map<string, unknown> = new Map([["u_time_at", "@"]]);
|
||||
const date = new Date(1727434767686);
|
||||
{
|
||||
const name = "fr";
|
||||
test(name, () => {
|
||||
expect(showDate(name, map, date)).toBe("27/09/2024 @ 12:59:27");
|
||||
});
|
||||
}
|
||||
{
|
||||
const name = "en-US";
|
||||
test(name, () => {
|
||||
expect(showDate(name, map, date)).toBe("9/27/24, @ 1:59:27");
|
||||
});
|
||||
}
|
||||
{
|
||||
const name = "unknown";
|
||||
test(name, () => {
|
||||
expect(showDate(name, map, date)).toBe("27/09/2024 @ 10:59:27");
|
||||
});
|
||||
}
|
||||
{
|
||||
const name = "zh-CN";
|
||||
test(name, () => {
|
||||
expect(showDate(name, map, date)).toBe("2024/9/27 @ 18:59:27");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in a new issue