jacobtread_obsidian-timekeep/src/export/markdown-table.test.ts

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);
});
});