Skip to content

Commit

Permalink
oneOf test default value
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed May 21, 2021
1 parent 4f32168 commit f93ba97
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/one.of.2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ describe('oneOf with discriminator', () => {
})
.expect(200));

it('should return 200 for cat and populate default color', async () =>
request(app)
.post(`${app.basePath}/discriminator_implied`)
.set('content-type', 'application/json')
.send({
pet_type: 'CatObject',
hunts: true,
age: 10,
})
.expect(200)
.then((r) => {
expect(r.body.color).to.eql('gray');
}));
it('should return 400 for dog with cat props', async () =>
request(app)
.post(`${app.basePath}/discriminator_implied`)
Expand Down

0 comments on commit f93ba97

Please sign in to comment.