1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00
awx/__tests__/index.test.jsx
2018-11-02 13:45:11 -04:00

23 lines
569 B
JavaScript

import React from 'react';
import ReactDOM from 'react-dom';
import api from '../src/api';
import indexToRender from '../src/index';
const custom_logo = (<div>logo</div>);
const custom_login_info = 'custom login info';
jest.mock('react-dom', () => ({ render: jest.fn() }));
describe('index.jsx', () => {
test('renders without crashing', async () => {
api.getRoot = jest.fn().mockImplementation(() => Promise
.resolve({ data: { custom_logo, custom_login_info } }));
await indexToRender();
expect(ReactDOM.render).toHaveBeenCalled();
});
});