Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Jan 3, 2020
1 parent 5a4057d commit 954a71a
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion x-pack/legacy/plugins/alerting/server/routes/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,33 @@ test('creates an alert with proper parameters', async () => {
expect(statusCode).toBe(200);
const response = JSON.parse(payload);
expect(new Date(response.createdAt)).toEqual(createdAt);
expect(omit(response, 'createdAt', 'updatedAt')).toMatchInlineSnapshot();
expect(omit(response, 'createdAt', 'updatedAt')).toMatchInlineSnapshot(`
Object {
"actions": Array [
Object {
"actionTypeId": "test",
"group": "default",
"id": "2",
"params": Object {
"foo": true,
},
},
],
"alertTypeId": "1",
"consumer": "bar",
"id": "123",
"name": "abc",
"params": Object {
"bar": true,
},
"schedule": Object {
"interval": "10s",
},
"tags": Array [
"foo",
],
}
`);
expect(alertsClient.create).toHaveBeenCalledTimes(1);
expect(alertsClient.create.mock.calls[0]).toMatchInlineSnapshot(`
Array [
Expand Down

0 comments on commit 954a71a

Please sign in to comment.