mirror of
https://github.com/zadam/trilium.git
synced 2025-12-16 05:09:54 +01:00
test(dayjs): relocate dayjs tests into commons
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { LOCALES } from "./i18n.js";
|
||||
import { DAYJS_LOADER } from "./dayjs.js";
|
||||
import { DAYJS_LOADER, dayjs } from "./dayjs.js";
|
||||
|
||||
describe("dayjs", () => {
|
||||
it("all dayjs locales are valid", async () => {
|
||||
@@ -10,4 +10,22 @@ describe("dayjs", () => {
|
||||
await dayjsLoader();
|
||||
}
|
||||
});
|
||||
|
||||
describe("Plugins", () => {
|
||||
it("is-same-or-before is available", () => {
|
||||
expect(dayjs("2023-10-01").isSameOrBefore(dayjs("2023-10-02"))).toBe(true);
|
||||
});
|
||||
|
||||
it("is-same-or-after is available", () => {
|
||||
expect(dayjs("2023-10-02").isSameOrAfter(dayjs("2023-10-01"))).toBe(true);
|
||||
});
|
||||
|
||||
it("is-between is available", () => {
|
||||
expect(dayjs("2023-10-02").isBetween(dayjs("2023-10-01"), dayjs("2023-10-03"))).toBe(true);
|
||||
});
|
||||
|
||||
it("advanced format is available", () => {
|
||||
expect(dayjs("2023-10-01").format("Q")).not.toBe("Q");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user