Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Oct 29, 2024
1 parent d640d67 commit ebace3b
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
"test:err": "gulp testerr",
"test:fmt": "gulp testfmt",
"test:lang": "gulp testlang",
"test:tutorials": "gulp testtutorials",
"update": "gulp update",
"watch-streamer": "cd docs/static/streamer && tsc -t es6 --watch",
"prepare": "node ./scripts/npm-prepare.js",
Expand Down
23 changes: 23 additions & 0 deletions tests/tutorial-test/baselines/hideDone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"editor": "blocksprj",
"title": "Hide Done",
"steps": [
{
"contentMd": "Tutorials can choose to hide the done button on the final step. This metadata is parsed and removed.",
"headerContentMd": "Tutorials can choose to hide the done button on the final step. This metadata is parsed and removed."
},
{
"contentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.\n\n```blocks\nlet x = 8;\nlet y = x + 2;\n```",
"headerContentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.",
"hintContentMd": "```blocks\nlet x = 8;\nlet y = x + 2;\n```"
}
],
"activities": null,
"code": [
"{\nlet x = 8;\nlet y = x + 2;\n}",
"{\nbasic.showIcon(IconNames.Square)\n}"
],
"metadata": {
"hideDone": true
}
}
23 changes: 23 additions & 0 deletions tests/tutorial-test/baselines/hideToolbox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"editor": "blocksprj",
"title": "Hide Toolbox",
"steps": [
{
"contentMd": "Tutorials can choose to hide the toolbox. This metadata is parsed and removed.",
"headerContentMd": "Tutorials can choose to hide the toolbox. This metadata is parsed and removed."
},
{
"contentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.\n\n```blocks\nlet x = 8;\nlet y = x + 2;\n```",
"headerContentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.",
"hintContentMd": "```blocks\nlet x = 8;\nlet y = x + 2;\n```"
}
],
"activities": null,
"code": [
"{\nlet x = 8;\nlet y = x + 2;\n}",
"{\nbasic.showIcon(IconNames.Square)\n}"
],
"metadata": {
"hideToolbox": true
}
}
20 changes: 20 additions & 0 deletions tests/tutorial-test/cases/hideDone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Hide Done

### @hideDone true

## Introduction

Tutorials can choose to hide the done button on the final step. This metadata is parsed and removed.

## Step with hint

Tutorial parsing for hints, steps, etc should function exactly as before.

```blocks
let x = 8;
let y = x + 2;
```

```ghost
basic.showIcon(IconNames.Square)
```
20 changes: 20 additions & 0 deletions tests/tutorial-test/cases/hideToolbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Hide Toolbox

### @hideToolbox true

## Introduction

Tutorials can choose to hide the toolbox. This metadata is parsed and removed.

## Step with hint

Tutorial parsing for hints, steps, etc should function exactly as before.

```blocks
let x = 8;
let y = x + 2;
```

```ghost
basic.showIcon(IconNames.Square)
```

0 comments on commit ebace3b

Please sign in to comment.