Skip to content

Commit

Permalink
Merge branch 'fix/issue-with-monitor-list-fetch' into telemetry-test
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Apr 3, 2020
2 parents 79f0f3a + 0a86b20 commit 2e36af3
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { expectFixtureEql } from './helpers/expect_fixture_eql';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { makeChecksWithStatus } from './helpers/make_checks';
import { monitorStatesQueryString } from '../../../../../legacy/plugins/uptime/public/queries/monitor_states_query';
import { MonitorSummary } from '../../../../../legacy/plugins/uptime/common/graphql/types';

export default function({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
Expand Down Expand Up @@ -220,17 +221,15 @@ export default function({ getService }: FtrProviderContext) {
const { monitorStates } = await getMonitorStates({});
expect(monitorStates.summaries.length).to.eql(3);
// Summaries are by default sorted by monitor names
expect(monitorStates.summaries.map(summary => summary.monitor_id)).to.eql([
downMonitorId,
mixMonitorId,
upMonitorId,
]);
expect(
monitorStates.summaries.map((summary: MonitorSummary) => summary.monitor_id)
).to.eql([downMonitorId, mixMonitorId, upMonitorId]);
});

it('should return a monitor with mix state if check status filter is down', async () => {
const { monitorStates } = await getMonitorStates({ statusFilter: 'down' });
expect(monitorStates.summaries.length).to.eql(2);
monitorStates.summaries.forEach(summary => {
monitorStates.summaries.forEach((summary: MonitorSummary) => {
expect(summary.monitor_id).to.not.eql(upMonitorId);
});
});
Expand Down

0 comments on commit 2e36af3

Please sign in to comment.