Skip to content

Commit

Permalink
fix(schema): Add test cases for concatting and not overwriting (jquen…
Browse files Browse the repository at this point in the history
  • Loading branch information
cemalettin-work committed Dec 13, 2020
1 parent 08a86c5 commit 2af9417
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/mixed.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,19 @@ describe('Mixed Types ', () => {
}.should.throw(TypeError));
});

it('concat should not overwrite label and meta with undefined', function () {
const testLabel = "Test Label"
const testMeta = {
testField: "test field"
}
let baseSchema = mixed().label(testLabel).meta(testMeta)
const otherSchema = mixed()

baseSchema = baseSchema.concat(otherSchema)
expect(baseSchema.spec.label).to.equal(testLabel)
expect(baseSchema.spec.meta.testField).to.equal(testMeta.testField)
})

it('concat should allow mixed and other type', function () {
let inst = mixed().default('hi');

Expand Down

0 comments on commit 2af9417

Please sign in to comment.