Skip to content
Closed
Changes from all commits
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
test single hint on final level
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed Apr 3, 2021
commit b8ac5450b16fbefc82276f00c0b0070ae490724c
84 changes: 84 additions & 0 deletions tests/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,90 @@ The second uninterrupted step
};
expect(result.levels[0]).toEqual(expected.levels[0]);
});
it('should work with a single test on the final lesson', () => {
// issue: https://github.com/coderoad/coderoad-vscode/issues/480
const md = `# Title

Description.

## 1. Title 1

First level content.

### 1.1

The first step

### 1.2

The second uninterrupted step

#### HINTS

* First Hint with \`markdown\`. See **bold**`;
const skeleton = {
levels: [
{
id: "1",
steps: [
{
id: "1.1",
},
{
id: "1.2",
},
],
},
],
};
const result = parse({
text: md,
skeleton,
commits: {
"1.1:T": ["abcdef1"],
"1.1:S": ["123456789"],
"1.2:T": ["fedcba1"],
},
});
const expected = {
summary: {
description: "Description.",
},
levels: [
{
id: "1",
title: "Title 1",
summary: "First level content.",
content: "First level content.",
steps: [
{
id: "1.1",
content: "The first step",
setup: {
commits: ["abcdef1"],
},
solution: {
commits: ["123456789"],
},

},
{
id: "1.2",
content: "The second uninterrupted step",
setup: {
commits: ["fedcba1"],
},
hints: [
"First Hint with `markdown`. See **bold**"
],
},
],
},
{},
],
};
expect(result.levels[0]).toEqual(expected.levels[0]);
})
});
describe("subtasks", () => {
it("should parse subtasks", () => {
Expand Down