1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
import createStore from '~/error_tracking_settings/store';
import { TEST_HOST } from 'spec/test_constants';
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,
token: 'token',
selectedProject: {
slug: normalizedProject.slug,
name: normalizedProject.name,
organizationName: normalizedProject.organizationName,
organizationSlug: normalizedProject.organizationSlug,
},
};
export const transformedSettings = {
api_host: 'apiHost',
enabled: false,
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,
project: null,
token: '',
listProjectsEndpoint: TEST_HOST,
operationsSettingsEndpoint: TEST_HOST,
};
export const initialPopulatedState = {
apiHost: 'apiHost',
enabled: true,
project: JSON.stringify(projectList[0]),
token: 'token',
listProjectsEndpoint: TEST_HOST,
operationsSettingsEndpoint: TEST_HOST,
};
export const projectWithHtmlTemplate = {
...projectList[0],
name: '<strong>bold</strong>',
};
|