debian-mirror-gitlab/spec/frontend/alerts_settings/components/mocks/apollo_mock.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

142 lines
3.8 KiB
JavaScript
Raw Normal View History

2021-01-29 00:20:46 +05:30
const projectPath = '';
2021-04-17 20:07:23 +05:30
export const HTTP_ID = 'gid://gitlab/AlertManagement::HttpIntegration/7';
export const PROMETHEUS_ID = 'gid://gitlab/PrometheusService/12';
2021-01-29 00:20:46 +05:30
export const errorMsg = 'Something went wrong';
export const createHttpVariables = {
name: 'Test Pre',
active: true,
projectPath,
2021-04-17 20:07:23 +05:30
type: 'HTTP',
2021-01-29 00:20:46 +05:30
};
export const updateHttpVariables = {
name: 'Test Pre',
active: true,
2021-04-17 20:07:23 +05:30
id: HTTP_ID,
type: 'HTTP',
2021-01-29 00:20:46 +05:30
};
export const createPrometheusVariables = {
apiUrl: 'https://test-pre.com',
active: true,
projectPath,
2021-04-17 20:07:23 +05:30
type: 'PROMETHEUS',
2021-01-29 00:20:46 +05:30
};
export const updatePrometheusVariables = {
apiUrl: 'https://test-pre.com',
active: true,
2021-04-17 20:07:23 +05:30
id: PROMETHEUS_ID,
type: 'PROMETHEUS',
2021-01-29 00:20:46 +05:30
};
export const getIntegrationsQueryResponse = {
data: {
project: {
2022-01-26 12:08:38 +05:30
id: '1',
2021-01-29 00:20:46 +05:30
alertManagementIntegrations: {
nodes: [
{
2022-04-04 11:22:00 +05:30
__typename: 'AlertManagementIntegration',
2021-01-29 00:20:46 +05:30
id: '37',
type: 'HTTP',
active: true,
name: 'Test 5',
url:
'http://127.0.0.1:3000/h5bp/html5-boilerplate/alerts/notify/test-5/d4875758e67334f3.json',
token: '89eb01df471d990ff5162a1c640408cf',
apiUrl: null,
},
{
2022-04-04 11:22:00 +05:30
__typename: 'AlertManagementIntegration',
2021-01-29 00:20:46 +05:30
id: '41',
type: 'HTTP',
active: true,
name: 'Test 9999',
url:
'http://127.0.0.1:3000/h5bp/html5-boilerplate/alerts/notify/test-9999/b78a566e1776cfc2.json',
token: 'f7579aa03844e07af3b1f0fca3f79f81',
apiUrl: null,
},
{
2022-04-04 11:22:00 +05:30
__typename: 'AlertManagementIntegration',
2021-01-29 00:20:46 +05:30
id: '40',
type: 'HTTP',
active: true,
name: 'Test 6',
url:
'http://127.0.0.1:3000/h5bp/html5-boilerplate/alerts/notify/test-6/3e828ae28a240222.json',
token: '6536102a607a5dd74fcdde921f2349ee',
apiUrl: null,
},
{
2022-04-04 11:22:00 +05:30
__typename: 'AlertManagementIntegration',
2021-01-29 00:20:46 +05:30
id: '12',
type: 'PROMETHEUS',
active: false,
name: 'Prometheus',
url: 'http://127.0.0.1:3000/h5bp/html5-boilerplate/prometheus/alerts/notify.json',
token: '256f687c6225aa5d6ee50c3d68120c4c',
apiUrl: 'https://localhost.ieeeesassadasasa',
},
],
},
},
},
};
export const integrationToDestroy = {
2022-04-04 11:22:00 +05:30
__typename: 'AlertManagementIntegration',
2021-01-29 00:20:46 +05:30
id: '37',
type: 'HTTP',
active: true,
name: 'Test 5',
url: 'http://127.0.0.1:3000/h5bp/html5-boilerplate/alerts/notify/test-5/d4875758e67334f3.json',
token: '89eb01df471d990ff5162a1c640408cf',
apiUrl: null,
};
export const destroyIntegrationResponse = {
data: {
httpIntegrationDestroy: {
errors: [],
integration: {
2022-06-21 17:19:12 +05:30
__typename: 'AlertManagementHttpIntegration',
2021-01-29 00:20:46 +05:30
id: '37',
type: 'HTTP',
active: true,
name: 'Test 5',
url:
'http://127.0.0.1:3000/h5bp/html5-boilerplate/alerts/notify/test-5/d4875758e67334f3.json',
token: '89eb01df471d990ff5162a1c640408cf',
apiUrl: null,
2021-04-17 20:07:23 +05:30
payloadExample: '{"field": "value"}',
payloadAttributeMappings: [],
payloadAlertFields: [],
2021-01-29 00:20:46 +05:30
},
},
},
};
export const destroyIntegrationResponseWithErrors = {
data: {
httpIntegrationDestroy: {
errors: ['Houston, we have a problem'],
integration: {
id: '37',
type: 'HTTP',
active: true,
name: 'Test 5',
url:
'http://127.0.0.1:3000/h5bp/html5-boilerplate/alerts/notify/test-5/d4875758e67334f3.json',
token: '89eb01df471d990ff5162a1c640408cf',
apiUrl: null,
2021-04-17 20:07:23 +05:30
payloadExample: '{"field": "value"}',
payloadAttributeMappings: [],
payloadAlertFields: [],
2021-01-29 00:20:46 +05:30
},
},
},
};