redoc/src/__tests__/standalone.test.tsx

21 lines
628 B
TypeScript
Raw Normal View History

2018-05-16 13:08:27 +03:00
/* tslint:disable:no-implicit-dependencies */
2018-03-26 21:55:46 +03:00
import { mount } from 'enzyme';
2018-05-16 13:08:27 +03:00
import * as React from 'react';
2021-06-02 15:53:36 +03:00
import * as yaml from 'js-yaml';
2018-03-26 21:55:46 +03:00
import { readFileSync } from 'fs';
import { resolve } from 'path';
import { Loading, RedocStandalone } from '../components/';
2018-03-26 21:55:46 +03:00
describe('Components', () => {
describe('RedocStandalone', () => {
test('should show loading first', () => {
2021-06-02 15:53:36 +03:00
const spec = yaml.load(readFileSync(resolve(__dirname, '../../demo/openapi.yaml'), 'utf-8'));
2018-03-26 21:55:46 +03:00
2018-05-16 13:08:27 +03:00
const inst = mount(<RedocStandalone spec={spec} options={{}} />);
2018-03-26 21:55:46 +03:00
expect(inst.find(Loading)).toHaveLength(1);
});
});
});