mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 23:55:47 -06:00
Alerting: Fix flakey silence test (#61395)
This commit is contained in:
parent
447e56b557
commit
6b620c79e0
@ -268,7 +268,6 @@ describe('Silence edit', () => {
|
|||||||
|
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
const end = new Date(start.getTime() + 24 * 60 * 60 * 1000);
|
const end = new Date(start.getTime() + 24 * 60 * 60 * 1000);
|
||||||
const now = dateTime().format('YYYY-MM-DD HH:mm');
|
|
||||||
|
|
||||||
const startDateString = dateTime(start).format('YYYY-MM-DD');
|
const startDateString = dateTime(start).format('YYYY-MM-DD');
|
||||||
const endDateString = dateTime(end).format('YYYY-MM-DD');
|
const endDateString = dateTime(end).format('YYYY-MM-DD');
|
||||||
@ -312,7 +311,7 @@ describe('Silence edit', () => {
|
|||||||
expect(mocks.api.createOrUpdateSilence).toHaveBeenCalledWith(
|
expect(mocks.api.createOrUpdateSilence).toHaveBeenCalledWith(
|
||||||
'grafana',
|
'grafana',
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
comment: `created ${now}`,
|
comment: expect.stringMatching(/created (\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})/),
|
||||||
matchers: [
|
matchers: [
|
||||||
{ isEqual: true, isRegex: false, name: 'foo', value: 'bar' },
|
{ isEqual: true, isRegex: false, name: 'foo', value: 'bar' },
|
||||||
{ isEqual: false, isRegex: false, name: 'bar', value: 'buzz' },
|
{ isEqual: false, isRegex: false, name: 'bar', value: 'buzz' },
|
||||||
|
Loading…
Reference in New Issue
Block a user