Skip to content

Commit

Permalink
added test for jdorn#823
Browse files Browse the repository at this point in the history
  • Loading branch information
schmunk42 committed Sep 30, 2020
1 parent d927bff commit bd4197a
Show file tree
Hide file tree
Showing 3 changed files with 757 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/codeceptjs/meta-schema_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var assert = require('assert');

Feature('core');

// https://github.com/json-editor/json-editor/issues/823
Scenario('work with JsonSchema meta-schema', async (I) => {
I.amOnPage('issues/issue-gh-823-meta-schema.html');
I.click('Object Properties');
I.click('options');
I.see('$ref');
I.see('options');
//pause();
I.click('Object Properties');
I.click('Object Properties');
I.see('options');
});

35 changes: 35 additions & 0 deletions tests/pages/issues/issue-gh-823-meta-schema.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Meta Schema - Test Template</title>
<script src="../../../dist/nonmin/jsoneditor.js"></script>
</head>
<body>
<h1>Meta Schema - Test Template</h1>

<div id='editor_holder'></div>
<button id='submit'>Submit (console.log)</button>

<script>
var metaSchema;


// load meta_schema.json
metaSchema = fetch("../meta_schema.json")
.then(response => response.json())
.then(data => metaSchema = data)
.then(() => console.log(metaSchema))
.then(() => editor = new JSONEditor(document.getElementById('editor_holder'), {
schema: metaSchema,
}
));

// Hook up the submit button to log to the console
document.getElementById('submit').addEventListener('click',function() {
// Get the value from the editor
console.log(editor.getValue());
});
</script>
</body>
</html>
Loading

0 comments on commit bd4197a

Please sign in to comment.