Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
setup summary parse tests
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed Jun 16, 2020
commit 4a21eecee94955a252c7ea014deaa13f5bd98f76
37 changes: 36 additions & 1 deletion tests/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,45 @@ But not including this line.
title: "Put Level's title here",
summary: "Some text.",
content: "Some text.\n\nBut not including this line.",
steps: [],
},
],
};
expect(result.levels[0]).toEqual(expected.levels[0]);
});

it("should truncate a level with an empty summary", () => {
const md = `# Title

Description.

## L1 Put Level's title here

>

Some text.

But not including this line.
`;

const skeleton = { levels: [{ id: "L1" }] };
const result = parse({
text: md,
skeleton,
commits: {},
});
const expected = {
levels: [
{
id: "L1",
title: "Put Level's title here",
summary: "Some text.",
content: "Some text.\n\nBut not including this line.",
steps: [],
},
],
};
expect(result.levels[0].summary).toEqual("Some text.");
expect(result.levels[0]).toEqual(expected.levels[0]);
});

it("should match line breaks with double line breaks for proper spacing", () => {
Expand Down