mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 16:58:46 -03:30
Fix unit test.
This commit is contained in:
@@ -203,6 +203,7 @@ describe('<Formik><MultiCredentialsLookup /></Formik>', () => {
|
|||||||
await act(async () => {
|
await act(async () => {
|
||||||
searchButton.invoke('onClick')();
|
searchButton.invoke('onClick')();
|
||||||
});
|
});
|
||||||
|
expect(CredentialsAPI.read).toHaveBeenCalledTimes(2);
|
||||||
const select = await waitForElement(wrapper, 'AnsibleSelect');
|
const select = await waitForElement(wrapper, 'AnsibleSelect');
|
||||||
CredentialsAPI.read.mockResolvedValueOnce({
|
CredentialsAPI.read.mockResolvedValueOnce({
|
||||||
data: {
|
data: {
|
||||||
@@ -212,12 +213,10 @@ describe('<Formik><MultiCredentialsLookup /></Formik>', () => {
|
|||||||
count: 1,
|
count: 1,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
expect(CredentialsAPI.read).toHaveBeenCalledTimes(1);
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
select.invoke('onChange')({}, 500);
|
select.invoke('onChange')({}, 500);
|
||||||
});
|
});
|
||||||
wrapper.update();
|
wrapper.update();
|
||||||
expect(CredentialsAPI.read).toHaveBeenCalledTimes(2);
|
|
||||||
expect(wrapper.find('OptionsList').prop('options')).toEqual([
|
expect(wrapper.find('OptionsList').prop('options')).toEqual([
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user