mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 03:01:21 -04:00
synthetics - adjust enabled key for browser monitors (#135017)
This commit is contained in:
parent
c6768782f3
commit
5989f1df49
2 changed files with 39 additions and 1 deletions
|
@ -101,7 +101,7 @@ export const normalizeProjectMonitor = ({
|
||||||
[ConfigKey.ORIGINAL_SPACE]: namespace || defaultFields[ConfigKey.ORIGINAL_SPACE],
|
[ConfigKey.ORIGINAL_SPACE]: namespace || defaultFields[ConfigKey.ORIGINAL_SPACE],
|
||||||
[ConfigKey.CUSTOM_HEARTBEAT_ID]: `${monitor.id}-${projectId}-${namespace}`,
|
[ConfigKey.CUSTOM_HEARTBEAT_ID]: `${monitor.id}-${projectId}-${namespace}`,
|
||||||
[ConfigKey.TIMEOUT]: null,
|
[ConfigKey.TIMEOUT]: null,
|
||||||
[ConfigKey.ENABLED]: monitor.enabled || defaultFields[ConfigKey.ENABLED],
|
[ConfigKey.ENABLED]: monitor.enabled ?? defaultFields[ConfigKey.ENABLED],
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
...DEFAULT_FIELDS[DataStream.BROWSER],
|
...DEFAULT_FIELDS[DataStream.BROWSER],
|
||||||
|
|
|
@ -629,5 +629,43 @@ export default function ({ getService }: FtrProviderContext) {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('project monitors - is able to enable and disable monitors', async () => {
|
||||||
|
try {
|
||||||
|
await supertest
|
||||||
|
.put(API_URLS.SYNTHETICS_MONITORS_PROJECT)
|
||||||
|
.set('kbn-xsrf', 'true')
|
||||||
|
.send(projectMonitors);
|
||||||
|
|
||||||
|
await supertest
|
||||||
|
.put(API_URLS.SYNTHETICS_MONITORS_PROJECT)
|
||||||
|
.set('kbn-xsrf', 'true')
|
||||||
|
.send({
|
||||||
|
...projectMonitors,
|
||||||
|
monitors: [
|
||||||
|
{
|
||||||
|
...projectMonitors.monitors[0],
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
.expect(200);
|
||||||
|
const response = await supertest
|
||||||
|
.get(API_URLS.SYNTHETICS_MONITORS)
|
||||||
|
.query({
|
||||||
|
filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`,
|
||||||
|
})
|
||||||
|
.set('kbn-xsrf', 'true')
|
||||||
|
.expect(200);
|
||||||
|
const { monitors } = response.body;
|
||||||
|
expect(monitors[0].attributes.enabled).eql(false);
|
||||||
|
} finally {
|
||||||
|
await Promise.all([
|
||||||
|
projectMonitors.monitors.map((monitor) => {
|
||||||
|
return deleteMonitor(monitor.id, projectMonitors.project);
|
||||||
|
}),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue