Add failing Node._findSchema schema reference test

This commit is contained in:
Adam Vigneaux 2019-03-14 16:12:03 -04:00
parent c93b8f1305
commit c0915548de
No known key found for this signature in database
GPG Key ID: 6DE177C0426B2E80
1 changed files with 20 additions and 1 deletions

View File

@ -57,7 +57,26 @@ describe('Node', function () {
Node._findSchema(schema, {}, path),
schema.properties.levelTwo.properties.levelThree.properties.bool
);
})
});
describe('with $ref', function () {
it('should find a referenced schema', function () {
var schema = {
type: 'object',
properties: {
foo: {
$ref: 'foo'
}
}
};
var fooSchema = {
type: 'number',
title: 'Foo'
};
var path = ['foo'];
assert.strictEqual(Node._findSchema(schema, {foo: fooSchema}, path), fooSchema);
});
});
describe('with pattern properties', function () {
it('should find schema', function () {