mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
chore: add test
This commit is contained in:
parent
02c57403db
commit
c51cb33064
27
src/services/__tests__/models/RequestBody.test.ts
Normal file
27
src/services/__tests__/models/RequestBody.test.ts
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
import { RequestBodyModel } from '../../models/RequestBody';
|
||||||
|
import { OpenAPIParser } from '../../OpenAPIParser';
|
||||||
|
import { RedocNormalizedOptions } from '../../RedocNormalizedOptions';
|
||||||
|
|
||||||
|
const opts = new RedocNormalizedOptions({});
|
||||||
|
describe('Models', () => {
|
||||||
|
describe('RequestBodyModel', () => {
|
||||||
|
let parser, props;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
parser = new OpenAPIParser({ openapi: '3.0.0' } as any, undefined, opts);
|
||||||
|
props = {
|
||||||
|
parser,
|
||||||
|
infoOrRef: {},
|
||||||
|
options: opts,
|
||||||
|
isEvent: false,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
test('should work with default props', () => {
|
||||||
|
const consoleError = jest.spyOn(global.console, 'error');
|
||||||
|
const req = new RequestBodyModel(props);
|
||||||
|
expect(consoleError).not.toHaveBeenCalled();
|
||||||
|
expect(req).toEqual({ description: '', required: false });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user