summaryrefslogtreecommitdiff
path: root/spec/frontend/vue_shared/issuable/list/mock_data.js
blob: e2fa99f7cc9941bd2af2e26a567603dc74daba67 (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import {
  mockAuthorToken,
  mockLabelToken,
  mockSortOptions,
} from 'jest/vue_shared/components/filtered_search_bar/mock_data';

export const mockAuthor = {
  id: 'gid://gitlab/User/1',
  avatarUrl: 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
  name: 'Administrator',
  username: 'root',
  webUrl: 'http://0.0.0.0:3000/root',
};

export const mockRegularLabel = {
  id: 'gid://gitlab/GroupLabel/2048',
  title: 'Documentation Update',
  description: null,
  color: '#F0AD4E',
  textColor: '#FFFFFF',
};

export const mockScopedLabel = {
  id: 'gid://gitlab/ProjectLabel/2049',
  title: 'status::confirmed',
  description: null,
  color: '#D9534F',
  textColor: '#FFFFFF',
};

export const mockLabels = [mockRegularLabel, mockScopedLabel];

export const mockCurrentUserTodo = {
  id: 'gid://gitlab/Todo/489',
  state: 'done',
};

export const mockIssuable = {
  iid: '30',
  title: 'Dismiss Cipher with no integrity',
  titleHtml: 'Dismiss Cipher with no integrity',
  description: 'fortitudinis _fomentis_ dolor mitigari solet.',
  descriptionHtml: 'fortitudinis <i>fomentis</i> dolor mitigari solet.',
  state: 'opened',
  createdAt: '2020-06-29T13:52:56Z',
  updatedAt: '2020-09-10T11:41:13Z',
  webUrl: 'http://0.0.0.0:3000/gitlab-org/gitlab-shell/-/issues/30',
  blocked: false,
  confidential: false,
  author: mockAuthor,
  labels: {
    nodes: mockLabels,
  },
  assignees: [mockAuthor],
  userDiscussionsCount: 2,
  taskCompletionStatus: {
    count: 2,
    completedCount: 1,
  },
};

export const mockIssuables = [
  mockIssuable,
  {
    iid: '28',
    title: 'Dismiss Cipher with no integrity',
    description: null,
    createdAt: '2020-06-29T13:52:56Z',
    updatedAt: '2020-06-29T13:52:56Z',
    webUrl: 'http://0.0.0.0:3000/gitlab-org/gitlab-shell/-/issues/28',
    author: mockAuthor,
    labels: {
      nodes: [],
    },
  },
  {
    iid: '7',
    title: 'Temporibus in veritatis labore explicabo velit molestiae sed.',
    description: 'Quo consequatur rem aliquid laborum quibusdam molestiae saepe.',
    createdAt: '2020-06-25T13:50:14Z',
    updatedAt: '2020-08-25T06:09:27Z',
    webUrl: 'http://0.0.0.0:3000/gitlab-org/gitlab-shell/-/issues/7',
    author: mockAuthor,
    labels: {
      nodes: mockLabels,
    },
  },
  {
    iid: '17',
    title: 'Vel voluptatem quaerat est hic incidunt qui ut aliquid sit exercitationem.',
    description: 'Incidunt accusamus perspiciatis aut excepturi.',
    createdAt: '2020-06-19T13:51:36Z',
    updatedAt: '2020-08-11T13:36:35Z',
    webUrl: 'http://0.0.0.0:3000/gitlab-org/gitlab-shell/-/issues/17',
    author: mockAuthor,
    labels: {
      nodes: [],
    },
  },
  {
    iid: '16',
    title: 'Vero qui quo labore libero omnis quisquam et cumque.',
    description: 'Ipsa ipsum magni nostrum alias aut exercitationem.',
    createdAt: '2020-06-19T13:51:36Z',
    updatedAt: '2020-06-19T13:51:36Z',
    webUrl: 'http://0.0.0.0:3000/gitlab-org/gitlab-shell/-/issues/16',
    author: mockAuthor,
    labels: {
      nodes: [],
    },
  },
];

export const mockTabs = [
  {
    id: 'state-opened',
    name: 'opened',
    title: 'Open',
    titleTooltip: 'Filter by issuables that are currently opened.',
  },
  {
    id: 'state-archived',
    name: 'closed',
    title: 'Closed',
    titleTooltip: 'Filter by issuables that are currently archived.',
  },
  {
    id: 'state-all',
    name: 'all',
    title: 'All',
    titleTooltip: 'Show all issuables.',
  },
];

export const mockTabCounts = {
  opened: 5,
  closed: 0,
  all: undefined,
};

export const mockIssuableListProps = {
  namespace: 'gitlab-org/gitlab-test',
  recentSearchesStorageKey: 'issues',
  searchInputPlaceholder: 'Search issues',
  searchTokens: [mockAuthorToken, mockLabelToken],
  sortOptions: mockSortOptions,
  issuables: mockIssuables,
  tabs: mockTabs,
  tabCounts: mockTabCounts,
  currentTab: 'opened',
};