tests: rewrite test to not use useless snapshot

This commit is contained in:
Roman Hotsiy 2018-01-30 16:47:17 +02:00
parent a6ae43a136
commit a7e9254b6c
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
2 changed files with 5 additions and 1008 deletions

View File

@ -23,8 +23,11 @@ describe('Components', () => {
'#/components/schemas/Pet',
options,
);
const schemaView = shallow(<Schema schema={schema} />);
expect(toJson(schemaView)).toMatchSnapshot();
const schemaViewElement = shallow(<Schema schema={schema} />).getElement();
expect(schemaViewElement.type).toEqual(ObjectSchema);
expect(schemaViewElement.props.discriminator).toBeDefined();
expect(schemaViewElement.props.discriminator.parentSchema).toBeDefined();
expect(schemaViewElement.props.discriminator.fieldName).toEqual('type');
});
it('should correctly render discriminator dropdown', () => {