Skip to content

Commit

Permalink
add time id extraction test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuanqi Sun committed Sep 2, 2023
1 parent 24c2579 commit 5df5296
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/tools/markdown-converter/lib.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ describe("header", () => {
);
});

it("extracts time id from metadata", () => {
assert.strictEqual(
handleHeaderLines("", fileToLines(`#+title: hello\n#+created: 2023-08-19T23:59:59Z`).headerLines).timeId,
`20230819235959`
);
assert.strictEqual(
handleHeaderLines("", fileToLines(`#+title: hello\n#+created: 2023-08-19T23:59:59-01:00`).headerLines).timeId,
`20230820005959`
);
});

it("empty tags", () => {
assert.strictEqual(
handleHeaderLines("", fileToLines(`#+title: hello\n#+tags: \n#+created: 2000-01-01T00:00:00Z`).headerLines)
Expand Down

0 comments on commit 5df5296

Please sign in to comment.