mirror of
https://github.com/grafana/grafana.git
synced 2025-09-20 05:02:31 +08:00
![renovate[bot]](/assets/img/avatar_default.png)
* Update dependency msw to v1 * Fix breaking change --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
14 lines
679 B
TypeScript
14 lines
679 B
TypeScript
import { rest } from 'msw';
|
|
import { SetupServer } from 'msw/node';
|
|
|
|
import { ExternalAlertmanagersResponse } from '../../../../plugins/datasource/alertmanager/types';
|
|
import { AlertmanagersChoiceResponse } from '../api/alertmanagerApi';
|
|
|
|
export function mockAlertmanagerChoiceResponse(server: SetupServer, respose: AlertmanagersChoiceResponse) {
|
|
server.use(rest.get('/api/v1/ngalert', (req, res, ctx) => res(ctx.status(200), ctx.json(respose))));
|
|
}
|
|
|
|
export function mockAlertmanagersResponse(server: SetupServer, response: ExternalAlertmanagersResponse) {
|
|
server.use(rest.get('/api/v1/ngalert/alertmanagers', (req, res, ctx) => res(ctx.status(200), ctx.json(response))));
|
|
}
|