mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Simplify mocking useGetContactPointsState (#56842)
This commit is contained in:
parent
0295177bb0
commit
d957fe01f4
@ -12,7 +12,7 @@ import {
|
||||
import { configureStore } from 'app/store/configureStore';
|
||||
import { ContactPointsState, NotifierDTO, NotifierType } from 'app/types';
|
||||
|
||||
import { useGetContactPointsState } from '../../api/receiversApi';
|
||||
import * as receiversApi from '../../api/receiversApi';
|
||||
import { fetchGrafanaNotifiersAction } from '../../state/actions';
|
||||
|
||||
import { ReceiversTable } from './ReceiversTable';
|
||||
@ -53,12 +53,7 @@ const mockNotifier = (type: NotifierType, name: string): NotifierDTO => ({
|
||||
options: [],
|
||||
});
|
||||
|
||||
jest.mock('../../api/receiversApi', () => ({
|
||||
...jest.requireActual('../../api/receiversApi'),
|
||||
useGetContactPointsState: jest.fn(),
|
||||
}));
|
||||
|
||||
const useGetContactPointsStateMock = jest.mocked(useGetContactPointsState);
|
||||
const useGetContactPointsStateMock = jest.spyOn(receiversApi, 'useGetContactPointsState');
|
||||
|
||||
describe('ReceiversTable', () => {
|
||||
beforeEach(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user