fix tests

This commit is contained in:
Keith Grant 2020-05-19 09:14:52 -07:00
parent e57bd88bd2
commit 455cd74492
2 changed files with 7 additions and 4 deletions

View File

@ -156,7 +156,7 @@ describe('<MultiCredentialsLookup />', () => {
});
});
wrapper.update();
act(() => {
await act(async () => {
wrapper.find('Button[variant="primary"]').invoke('onClick')();
});
expect(onChange).toBeCalledWith([
@ -201,7 +201,7 @@ describe('<MultiCredentialsLookup />', () => {
});
});
wrapper.update();
act(() => {
await act(async () => {
wrapper.find('Button[variant="primary"]').invoke('onClick')();
});
expect(onChange).toBeCalledWith([
@ -248,7 +248,7 @@ describe('<MultiCredentialsLookup />', () => {
});
});
wrapper.update();
act(() => {
await act(async () => {
wrapper.find('Button[variant="primary"]').invoke('onClick')();
});
expect(onChange).toBeCalledWith([
@ -301,7 +301,7 @@ describe('<MultiCredentialsLookup />', () => {
});
});
wrapper.update();
act(() => {
await act(async () => {
wrapper.find('Button[variant="primary"]').invoke('onClick')();
});
expect(onChange).toBeCalledWith([

View File

@ -14,6 +14,9 @@ function PlaybookSelect({ projectId, isValid, field, onBlur, onError, i18n }) {
error,
} = useRequest(
useCallback(async () => {
if (!projectId) {
return [];
}
const { data } = await ProjectsAPI.readPlaybooks(projectId);
const opts = (data || []).map(playbook => ({
value: playbook,