mirror of
https://github.com/ansible/awx.git
synced 2026-02-01 09:38:10 -03:30
Lift config context one level higher.
- Refactor About component to use config context. - Update About component unit tests.
This commit is contained in:
@@ -31,26 +31,4 @@ describe('<About />', () => {
|
||||
expect(onAboutModalClose).toBeCalled();
|
||||
aboutWrapper.unmount();
|
||||
});
|
||||
|
||||
test('sets error on api request failure', async () => {
|
||||
api.get = jest.fn().mockImplementation(() => {
|
||||
const err = new Error('404 error');
|
||||
err.response = { status: 404, message: 'problem' };
|
||||
return Promise.reject(err);
|
||||
});
|
||||
aboutWrapper = mount(
|
||||
<I18nProvider>
|
||||
<About isOpen />
|
||||
</I18nProvider>
|
||||
);
|
||||
|
||||
const aboutComponentInstance = aboutWrapper.find(About).instance();
|
||||
await aboutComponentInstance.componentDidMount();
|
||||
expect(aboutComponentInstance.state.error.response.status).toBe(404);
|
||||
aboutWrapper.unmount();
|
||||
});
|
||||
|
||||
test('API Config endpoint is valid', () => {
|
||||
expect(API_CONFIG).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user