Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mock_data.js « users « organizations « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 16b3ec3bbcbeaf2265b5914e1adebaef50ca4dc7 (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
const createUser = (id) => {
  return {
    id: `gid://gitlab/User/${id}`,
    username: `test_user_${id}`,
    avatarUrl: `/path/test_user_${id}`,
    name: `Test User ${id}`,
    publicEmail: `test_user_${id}@gitlab.com`,
    createdAt: Date.now(),
    lastActivityOn: Date.now(),
  };
};

export const MOCK_ORGANIZATION_GID = 'gid://gitlab/Organizations::Organization/1';

export const MOCK_PATHS = {
  adminUser: '/admin/users/:id',
};

export const MOCK_USERS = [
  {
    badges: [],
    id: 'gid://gitlab/Organizations::OrganizationUser/3',
    user: createUser(3),
  },
  {
    badges: [],
    id: 'gid://gitlab/Organizations::OrganizationUser/2',
    user: createUser(2),
  },
  {
    badges: [
      { text: 'Admin', variant: 'success' },
      { text: "It's you!", variant: 'muted' },
    ],
    id: 'gid://gitlab/Organizations::OrganizationUser/1',
    user: createUser(1),
  },
];

export const MOCK_USERS_FORMATTED = MOCK_USERS.map(({ badges, user }) => {
  return { ...user, badges, email: user.publicEmail };
});

export const MOCK_PAGE_INFO = {
  startCursor: 'aaaa',
  endCursor: 'bbbb',
  hasNextPage: true,
  hasPreviousPage: true,
  __typename: 'PageInfo',
};