Skip to content

Commit

Permalink
Added nonObjectAnyOf test in uniforms-bridge-json-schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
Monteth committed Apr 21, 2021
1 parent 49b1dd0 commit 5636c0a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/uniforms-bridge-json-schema/__tests__/JSONSchemaBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@ describe('JSONSchemaBridge', () => {
maxItems: 3,
minItems: 1,
},
nonObjectAnyOf: {
anyOf: [
{
const: 'alphabetic',
type: 'string',
},
{
enum: ['top', 'middle', 'bottom'],
type: 'string',
},
{
type: 'number',
minimum: 0,
},
],
},
},
required: ['dateOfBirth'],
};
Expand Down Expand Up @@ -712,6 +728,13 @@ describe('JSONSchemaBridge', () => {
});
});

it('works with anyOf for a non-object computed property', () => {
expect(bridge.getProps('nonObjectAnyOf')).toHaveProperty(
'required',
false,
);
});

it('works with maxItems in props', () => {
expect(bridge.getProps('arrayWithAllOf')).toHaveProperty('maxCount', 3);
});
Expand Down Expand Up @@ -753,6 +776,7 @@ describe('JSONSchemaBridge', () => {
'passwordNumeric',
'recursive',
'arrayWithAllOf',
'nonObjectAnyOf',
]);
});

Expand Down

0 comments on commit 5636c0a

Please sign in to comment.