Skip to content

Fix/summary parse #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2020
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 <shawn.j.mckay@gmail.com>
  • 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