debian-mirror-gitlab/spec/frontend/error_tracking_settings/mock.js

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

104 lines
2.3 KiB
JavaScript
Raw Normal View History

2019-09-30 21:07:59 +05:30
import { TEST_HOST } from 'helpers/test_constants';
2020-01-01 13:55:28 +05:30
import createStore from '~/error_tracking_settings/store';
2019-07-07 11:18:12 +05:30
const defaultStore = createStore();
export const projectList = [
{
2023-03-17 16:20:25 +05:30
id: '1',
2019-07-07 11:18:12 +05:30
name: 'name',
slug: 'slug',
organizationName: 'organizationName',
organizationSlug: 'organizationSlug',
},
{
2023-03-17 16:20:25 +05:30
id: '2',
2019-07-07 11:18:12 +05:30
name: 'name2',
slug: 'slug2',
organizationName: 'organizationName2',
organizationSlug: 'organizationSlug2',
},
];
export const staleProject = {
2023-03-17 16:20:25 +05:30
id: '3',
2019-07-07 11:18:12 +05:30
name: 'staleName',
slug: 'staleSlug',
organizationName: 'staleOrganizationName',
organizationSlug: 'staleOrganizationSlug',
};
export const normalizedProject = {
2023-03-17 16:20:25 +05:30
id: '5',
2019-07-07 11:18:12 +05:30
name: 'name',
slug: 'slug',
organizationName: 'organization_name',
organizationSlug: 'organization_slug',
};
export const sampleBackendProject = {
2023-03-17 16:20:25 +05:30
id: '5',
2019-07-07 11:18:12 +05:30
name: normalizedProject.name,
slug: normalizedProject.slug,
organization_name: normalizedProject.organizationName,
organization_slug: normalizedProject.organizationSlug,
};
export const sampleFrontendSettings = {
apiHost: 'apiHost',
enabled: false,
2021-11-11 11:23:49 +05:30
integrated: false,
2019-07-07 11:18:12 +05:30
token: 'token',
selectedProject: {
2023-03-17 16:20:25 +05:30
id: '5',
2019-07-07 11:18:12 +05:30
slug: normalizedProject.slug,
name: normalizedProject.name,
organizationName: normalizedProject.organizationName,
organizationSlug: normalizedProject.organizationSlug,
},
};
export const transformedSettings = {
api_host: 'apiHost',
enabled: false,
2021-11-11 11:23:49 +05:30
integrated: false,
2019-07-07 11:18:12 +05:30
token: 'token',
project: {
2023-03-17 16:20:25 +05:30
sentry_project_id: '5',
2019-07-07 11:18:12 +05:30
slug: normalizedProject.slug,
name: normalizedProject.name,
organization_name: normalizedProject.organizationName,
organization_slug: normalizedProject.organizationSlug,
},
};
export const defaultProps = {
...defaultStore.state,
...defaultStore.getters,
};
export const initialEmptyState = {
apiHost: '',
enabled: false,
2021-11-11 11:23:49 +05:30
integrated: false,
2019-07-07 11:18:12 +05:30
project: null,
token: '',
listProjectsEndpoint: TEST_HOST,
operationsSettingsEndpoint: TEST_HOST,
};
export const initialPopulatedState = {
apiHost: 'apiHost',
enabled: true,
2021-11-11 11:23:49 +05:30
integrated: true,
2019-07-07 11:18:12 +05:30
project: JSON.stringify(projectList[0]),
token: 'token',
listProjectsEndpoint: TEST_HOST,
operationsSettingsEndpoint: TEST_HOST,
};
export const projectWithHtmlTemplate = {
...projectList[0],
name: '<strong>bold</strong>',
};