mirror of
https://github.com/jacobtread/obsidian-timekeep.git
synced 2026-07-22 10:10:27 +00:00
28 lines
1 KiB
TypeScript
28 lines
1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { defaultSettings } from "@/settings";
|
|
|
|
import { createMarkdownTable } from "./markdown-table";
|
|
|
|
describe("createMarkdownTable", () => {
|
|
it("should create entry table rows", async () => {
|
|
const { entries, currentTime, output } = await import("./__fixtures__/markdown/tableRows");
|
|
const markdown = createMarkdownTable({ entries }, defaultSettings, currentTime);
|
|
expect(markdown).toEqual(output);
|
|
});
|
|
|
|
it("should flatten group entries", async () => {
|
|
const { entries, currentTime, output } =
|
|
await import("./__fixtures__/markdown/flattenGroupEntries");
|
|
const markdown = createMarkdownTable({ entries }, defaultSettings, currentTime);
|
|
expect(markdown).toEqual(output);
|
|
});
|
|
|
|
it("should use current time for unfinished entries", async () => {
|
|
const { entries, currentTime, output } =
|
|
await import("./__fixtures__/markdown/flattenGroupEntries");
|
|
|
|
const markdown = createMarkdownTable({ entries }, defaultSettings, currentTime);
|
|
expect(markdown).toEqual(output);
|
|
});
|
|
});
|