2019-07-10 09:27:39 -04:00
|
|
|
import { TEST_HOST } from 'helpers/test_constants';
|
2019-12-10 04:07:51 -05:00
|
|
|
import createStore from '~/error_tracking_settings/store';
|
2019-03-01 09:51:54 -05:00
|
|
|
|
|
|
|
const defaultStore = createStore();
|
|
|
|
|
|
|
|
export const projectList = [
|
|
|
|
{
|
|
|
|
name: 'name',
|
|
|
|
slug: 'slug',
|
|
|
|
organizationName: 'organizationName',
|
|
|
|
organizationSlug: 'organizationSlug',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'name2',
|
|
|
|
slug: 'slug2',
|
|
|
|
organizationName: 'organizationName2',
|
|
|
|
organizationSlug: 'organizationSlug2',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
export const staleProject = {
|
|
|
|
name: 'staleName',
|
|
|
|
slug: 'staleSlug',
|
|
|
|
organizationName: 'staleOrganizationName',
|
|
|
|
organizationSlug: 'staleOrganizationSlug',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const normalizedProject = {
|
|
|
|
name: 'name',
|
|
|
|
slug: 'slug',
|
|
|
|
organizationName: 'organization_name',
|
|
|
|
organizationSlug: 'organization_slug',
|
|
|
|
};
|
|
|
|
|
|
|
|
export const sampleBackendProject = {
|
|
|
|
name: normalizedProject.name,
|
|
|
|
slug: normalizedProject.slug,
|
|
|
|
organization_name: normalizedProject.organizationName,
|
|
|
|
organization_slug: normalizedProject.organizationSlug,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const sampleFrontendSettings = {
|
|
|
|
apiHost: 'apiHost',
|
|
|
|
enabled: false,
|
2021-09-15 17:11:12 -04:00
|
|
|
integrated: false,
|
2019-03-01 09:51:54 -05:00
|
|
|
token: 'token',
|
|
|
|
selectedProject: {
|
|
|
|
slug: normalizedProject.slug,
|
|
|
|
name: normalizedProject.name,
|
|
|
|
organizationName: normalizedProject.organizationName,
|
|
|
|
organizationSlug: normalizedProject.organizationSlug,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export const transformedSettings = {
|
|
|
|
api_host: 'apiHost',
|
|
|
|
enabled: false,
|
2021-09-15 17:11:12 -04:00
|
|
|
integrated: false,
|
2019-03-01 09:51:54 -05:00
|
|
|
token: 'token',
|
|
|
|
project: {
|
|
|
|
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-09-15 17:11:12 -04:00
|
|
|
integrated: false,
|
2019-03-01 09:51:54 -05:00
|
|
|
project: null,
|
|
|
|
token: '',
|
|
|
|
listProjectsEndpoint: TEST_HOST,
|
|
|
|
operationsSettingsEndpoint: TEST_HOST,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const initialPopulatedState = {
|
|
|
|
apiHost: 'apiHost',
|
|
|
|
enabled: true,
|
2021-09-15 17:11:12 -04:00
|
|
|
integrated: true,
|
2019-03-01 09:51:54 -05:00
|
|
|
project: JSON.stringify(projectList[0]),
|
|
|
|
token: 'token',
|
|
|
|
listProjectsEndpoint: TEST_HOST,
|
|
|
|
operationsSettingsEndpoint: TEST_HOST,
|
|
|
|
};
|
|
|
|
|
|
|
|
export const projectWithHtmlTemplate = {
|
|
|
|
...projectList[0],
|
|
|
|
name: '<strong>bold</strong>',
|
|
|
|
};
|