mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Update dependency @reduxjs/toolkit to v1.9.0 (#58247)
* Update dependency @reduxjs/toolkit to v1.9.0
* fix types on mockToolkitActionCreator
* Fix external AM selector tests
* timeout added in shared public dashboard test
* Revert "timeout added in shared public dashboard test"
This reverts commit 205c295192.
* update to @reduxjs/toolkit@1.9.1
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
Co-authored-by: Juan Cabanas <juan.cabanas@grafana.com>
This commit is contained in:
@@ -81,8 +81,8 @@ describe('useExternalDataSourceAlertmanagers', () => {
|
||||
const wrapper: React.FC = ({ children }) => <Provider store={store}>{children}</Provider>;
|
||||
|
||||
// Act
|
||||
const { result, waitForNextUpdate } = renderHook(() => useExternalDataSourceAlertmanagers(), { wrapper });
|
||||
await waitForNextUpdate();
|
||||
const { result, waitForValueToChange } = renderHook(() => useExternalDataSourceAlertmanagers(), { wrapper });
|
||||
await waitForValueToChange(() => result.current[0].status);
|
||||
|
||||
// Assert
|
||||
const { current } = result;
|
||||
@@ -114,8 +114,8 @@ describe('useExternalDataSourceAlertmanagers', () => {
|
||||
const wrapper: React.FC = ({ children }) => <Provider store={store}>{children}</Provider>;
|
||||
|
||||
// Act
|
||||
const { result, waitForNextUpdate } = renderHook(() => useExternalDataSourceAlertmanagers(), { wrapper });
|
||||
await waitForNextUpdate();
|
||||
const { result, waitForValueToChange } = renderHook(() => useExternalDataSourceAlertmanagers(), { wrapper });
|
||||
await waitForValueToChange(() => result.current[0].status);
|
||||
|
||||
// Assert
|
||||
const { current } = result;
|
||||
@@ -180,8 +180,8 @@ describe('useExternalDataSourceAlertmanagers', () => {
|
||||
const wrapper: React.FC = ({ children }) => <Provider store={store}>{children}</Provider>;
|
||||
|
||||
// Act
|
||||
const { result, waitForNextUpdate } = renderHook(() => useExternalDataSourceAlertmanagers(), { wrapper });
|
||||
await waitForNextUpdate();
|
||||
const { result, waitForValueToChange } = renderHook(() => useExternalDataSourceAlertmanagers(), { wrapper });
|
||||
await waitForValueToChange(() => result.current[0].status);
|
||||
|
||||
// Assert
|
||||
const { current } = result;
|
||||
@@ -213,11 +213,11 @@ describe('useExternalDataSourceAlertmanagers', () => {
|
||||
const wrapper: React.FC = ({ children }) => <Provider store={store}>{children}</Provider>;
|
||||
|
||||
// Act
|
||||
const { result, waitForNextUpdate } = renderHook(() => useExternalDataSourceAlertmanagers(), {
|
||||
const { result, waitForValueToChange } = renderHook(() => useExternalDataSourceAlertmanagers(), {
|
||||
wrapper,
|
||||
});
|
||||
|
||||
await waitForNextUpdate();
|
||||
await waitForValueToChange(() => result.current[0].status);
|
||||
|
||||
// Assert
|
||||
expect(result.current).toHaveLength(1);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ActionCreatorWithoutPayload, PayloadActionCreator } from '@reduxjs/toolkit';
|
||||
|
||||
export const mockToolkitActionCreator = (creator: PayloadActionCreator<any>) => {
|
||||
export const mockToolkitActionCreator = <T extends string>(creator: PayloadActionCreator<any, T>) => {
|
||||
return Object.assign(jest.fn(), creator);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user