2021-07-11 23:09:27 -04:00
|
|
|
import { GROUPS_LOCAL_STORAGE_KEY, PROJECTS_LOCAL_STORAGE_KEY } from '~/search/store/constants';
|
|
|
|
import * as types from '~/search/store/mutation_types';
|
|
|
|
|
2020-10-30 14:08:56 -04:00
|
|
|
export const MOCK_QUERY = {
|
|
|
|
scope: 'issues',
|
|
|
|
state: 'all',
|
|
|
|
confidential: null,
|
2021-06-02 20:09:49 -04:00
|
|
|
group_id: 1,
|
2020-10-30 14:08:56 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
export const MOCK_GROUP = {
|
2021-07-11 23:09:27 -04:00
|
|
|
id: 1,
|
2020-10-30 14:08:56 -04:00
|
|
|
name: 'test group',
|
2021-06-02 20:09:49 -04:00
|
|
|
full_name: 'full name / test group',
|
2020-10-30 14:08:56 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
export const MOCK_GROUPS = [
|
|
|
|
{
|
2021-07-11 23:09:27 -04:00
|
|
|
id: 1,
|
2021-06-02 20:09:49 -04:00
|
|
|
avatar_url: null,
|
2020-10-30 14:08:56 -04:00
|
|
|
name: 'test group',
|
2021-06-02 20:09:49 -04:00
|
|
|
full_name: 'full name / test group',
|
2020-10-30 14:08:56 -04:00
|
|
|
},
|
|
|
|
{
|
2021-07-11 23:09:27 -04:00
|
|
|
id: 2,
|
2021-06-02 20:09:49 -04:00
|
|
|
avatar_url: 'https://avatar.com',
|
2020-10-30 14:08:56 -04:00
|
|
|
name: 'test group 2',
|
2021-06-02 20:09:49 -04:00
|
|
|
full_name: 'full name / test group 2',
|
2020-10-30 14:08:56 -04:00
|
|
|
},
|
|
|
|
];
|
2020-12-15 07:10:17 -05:00
|
|
|
|
|
|
|
export const MOCK_PROJECT = {
|
2021-07-11 23:09:27 -04:00
|
|
|
id: 1,
|
2020-12-15 07:10:17 -05:00
|
|
|
name: 'test project',
|
2021-01-20 19:11:07 -05:00
|
|
|
namespace: MOCK_GROUP,
|
2021-06-02 20:09:49 -04:00
|
|
|
nameWithNamespace: 'test group / test project',
|
2020-12-15 07:10:17 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
export const MOCK_PROJECTS = [
|
|
|
|
{
|
2021-07-11 23:09:27 -04:00
|
|
|
id: 1,
|
2020-12-15 07:10:17 -05:00
|
|
|
name: 'test project',
|
2021-01-20 19:11:07 -05:00
|
|
|
namespace: MOCK_GROUP,
|
2021-06-02 20:09:49 -04:00
|
|
|
name_with_namespace: 'test group / test project',
|
2020-12-15 07:10:17 -05:00
|
|
|
},
|
|
|
|
{
|
2021-07-11 23:09:27 -04:00
|
|
|
id: 2,
|
2020-12-15 07:10:17 -05:00
|
|
|
name: 'test project 2',
|
2021-01-20 19:11:07 -05:00
|
|
|
namespace: MOCK_GROUP,
|
2021-06-02 20:09:49 -04:00
|
|
|
name_with_namespace: 'test group / test project 2',
|
2020-12-15 07:10:17 -05:00
|
|
|
},
|
|
|
|
];
|
2021-02-02 13:09:42 -05:00
|
|
|
|
|
|
|
export const MOCK_SORT_OPTIONS = [
|
|
|
|
{
|
|
|
|
title: 'Most relevant',
|
|
|
|
sortable: false,
|
|
|
|
sortParam: 'relevant',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Created date',
|
|
|
|
sortable: true,
|
|
|
|
sortParam: {
|
|
|
|
asc: 'created_asc',
|
|
|
|
desc: 'created_desc',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
2021-06-30 02:07:17 -04:00
|
|
|
|
|
|
|
export const MOCK_LS_KEY = 'mock-ls-key';
|
2021-07-11 23:09:27 -04:00
|
|
|
|
|
|
|
export const MOCK_INFLATED_DATA = [
|
|
|
|
{ id: 1, name: 'test 1' },
|
|
|
|
{ id: 2, name: 'test 2' },
|
|
|
|
];
|
|
|
|
|
|
|
|
export const FRESH_STORED_DATA = [
|
|
|
|
{ id: 1, name: 'test 1', frequency: 1 },
|
|
|
|
{ id: 2, name: 'test 2', frequency: 2 },
|
|
|
|
];
|
|
|
|
|
|
|
|
export const STALE_STORED_DATA = [
|
|
|
|
{ id: 1, name: 'blah 1', frequency: 1 },
|
|
|
|
{ id: 2, name: 'blah 2', frequency: 2 },
|
|
|
|
];
|
|
|
|
|
|
|
|
export const MOCK_FRESH_DATA_RES = { name: 'fresh' };
|
|
|
|
|
2021-08-05 02:09:25 -04:00
|
|
|
export const PRELOAD_EXPECTED_MUTATIONS = [
|
|
|
|
{
|
2021-07-11 23:09:27 -04:00
|
|
|
type: types.LOAD_FREQUENT_ITEMS,
|
|
|
|
payload: { key: GROUPS_LOCAL_STORAGE_KEY, data: FRESH_STORED_DATA },
|
|
|
|
},
|
2021-08-05 02:09:25 -04:00
|
|
|
{
|
2021-07-11 23:09:27 -04:00
|
|
|
type: types.LOAD_FREQUENT_ITEMS,
|
2021-08-05 02:09:25 -04:00
|
|
|
payload: { key: PROJECTS_LOCAL_STORAGE_KEY, data: FRESH_STORED_DATA },
|
2021-07-11 23:09:27 -04:00
|
|
|
},
|
2021-08-05 02:09:25 -04:00
|
|
|
];
|
|
|
|
|
|
|
|
export const PROMISE_ALL_EXPECTED_MUTATIONS = {
|
|
|
|
resGroups: {
|
2021-07-11 23:09:27 -04:00
|
|
|
type: types.LOAD_FREQUENT_ITEMS,
|
2021-08-05 02:09:25 -04:00
|
|
|
payload: { key: GROUPS_LOCAL_STORAGE_KEY, data: [MOCK_FRESH_DATA_RES, MOCK_FRESH_DATA_RES] },
|
2021-07-11 23:09:27 -04:00
|
|
|
},
|
|
|
|
resProjects: {
|
|
|
|
type: types.LOAD_FREQUENT_ITEMS,
|
|
|
|
payload: { key: PROJECTS_LOCAL_STORAGE_KEY, data: [MOCK_FRESH_DATA_RES, MOCK_FRESH_DATA_RES] },
|
|
|
|
},
|
|
|
|
};
|