mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 18:21:03 -03:30
and index.jsx tests
This commit is contained in:
22
__tests__/index.test.jsx
Normal file
22
__tests__/index.test.jsx
Normal file
@@ -0,0 +1,22 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user