mirror of
https://github.com/ansible/awx.git
synced 2026-02-14 01:34:45 -03:30
Fix & Add unit tests.
This commit is contained in:
@@ -126,4 +126,16 @@ describe('APIClient (api.js)', () => {
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
test('getInstanceGroups calls expected http method', async (done) => {
|
||||
const createPromise = () => Promise.resolve();
|
||||
const mockHttp = ({ get: jest.fn(createPromise) });
|
||||
|
||||
const api = new APIClient(mockHttp);
|
||||
await api.getInstanceGroups();
|
||||
|
||||
expect(mockHttp.get).toHaveBeenCalledTimes(1);
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user