Skip to content

Commit

Permalink
test(enum): test enums that have arrays as values
Browse files Browse the repository at this point in the history
see #219
  • Loading branch information
trieloff committed Apr 14, 2020
1 parent 290e2f0 commit 84129fe
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/fixtures/enums/arrayenums.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "file://foo/mod.json",
"title": "MI",
"description": "Specification for input JSON",
"type": "object",
"properties": {
"columns": {
"title": "Columns",
"meta:enum": {
"[\"P\",\"M\"]": "Post Meridiem?"
},
"enum": [
[
"P",
"M"
],
[
"M",
"P"
]
],
"type": "array"
}
},
"required": [
"columns"
]
}
5 changes: 5 additions & 0 deletions test/markdownBuilder.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ describe('Testing Markdown Builder: enums', () => {
.contains('bar: foo')
.contains('**enum**: the value of this property must be equal to one of the following values:');
});

it('Array Enums Schema looks OK', () => {
assertMarkdown(results.arrayenums)
.contains('| `["P","M"]` | Post Meridiem? |');
});
});

describe('Testing Markdown Builder: null', () => {
Expand Down

0 comments on commit 84129fe

Please sign in to comment.