summaryrefslogtreecommitdiff
path: root/spec/frontend/invite_members/mock_data/api_responses.js
blob: 4ad3b6aeb66c246b09ef9da8c6faa33f44c0c9f0 (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
const EMAIL_INVALID = {
  message: { error: 'email contains an invalid email address' },
};

const ERROR_EMAIL_INVALID = {
  error: 'email contains an invalid email address',
};

const EMAIL_RESTRICTED = {
  message: {
    'email@example.com':
      "The member's email address is not allowed for this project. Go to the Admin area > Sign-up restrictions, and check Allowed domains for sign-ups.",
  },
  status: 'error',
};

const MULTIPLE_RESTRICTED = {
  message: {
    'email@example.com':
      "The member's email address is not allowed for this project. Go to the Admin area > Sign-up restrictions, and check Allowed domains for sign-ups.",
    'email4@example.com':
      "The member's email address is not allowed for this project. Go to the Admin area > Sign-up restrictions, and check the Domain denylist.",
    root:
      "The member's email address is not allowed for this project. Go to the Admin area > Sign-up restrictions, and check Allowed domains for sign-ups.",
  },
  status: 'error',
};

const EMAIL_TAKEN = {
  message: {
    'email@example.org': "The member's email address has already been taken",
  },
  status: 'error',
};

export const GROUPS_INVITATIONS_PATH = '/api/v4/groups/1/invitations';

export const invitationsApiResponse = {
  EMAIL_INVALID,
  ERROR_EMAIL_INVALID,
  EMAIL_RESTRICTED,
  MULTIPLE_RESTRICTED,
  EMAIL_TAKEN,
};