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

user_callout_dismisser_mock_data.js « components « vue_shared « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7ca8c619ffcda0418c034d2c4e469a43c33d2f21 (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
export const userCalloutsResponse = (callouts = []) => ({
  data: {
    currentUser: {
      id: 'gid://gitlab/User/46',
      __typename: 'UserCore',
      callouts: {
        __typename: 'UserCalloutConnection',
        nodes: callouts.map((callout) => ({
          __typename: 'UserCallout',
          featureName: callout.toUpperCase(),
          dismissedAt: '2021-02-12T11:10:01Z',
        })),
      },
    },
  },
});

export const anonUserCalloutsResponse = () => ({ data: { currentUser: null } });

export const userCalloutMutationResponse = (variables, errors = []) => ({
  data: {
    userCalloutCreate: {
      errors,
      userCallout: {
        featureName: variables.input.featureName.toUpperCase(),
        dismissedAt: '2021-02-12T11:10:01Z',
      },
    },
  },
});