diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/frontend/projects/settings/branch_rules/components/view/mock_data.js | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/frontend/projects/settings/branch_rules/components/view/mock_data.js')
-rw-r--r-- | spec/frontend/projects/settings/branch_rules/components/view/mock_data.js | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/spec/frontend/projects/settings/branch_rules/components/view/mock_data.js b/spec/frontend/projects/settings/branch_rules/components/view/mock_data.js index c3f573061da..c07d4673344 100644 --- a/spec/frontend/projects/settings/branch_rules/components/view/mock_data.js +++ b/spec/frontend/projects/settings/branch_rules/components/view/mock_data.js @@ -1,29 +1,34 @@ const usersMock = [ { + id: '123', username: 'usr1', webUrl: 'http://test.test/usr1', name: 'User 1', avatarUrl: 'http://test.test/avt1.png', }, { + id: '456', username: 'usr2', webUrl: 'http://test.test/usr2', name: 'User 2', avatarUrl: 'http://test.test/avt2.png', }, { + id: '789', username: 'usr3', webUrl: 'http://test.test/usr3', name: 'User 3', avatarUrl: 'http://test.test/avt3.png', }, { + id: '987', username: 'usr4', webUrl: 'http://test.test/usr4', name: 'User 4', avatarUrl: 'http://test.test/avt4.png', }, { + id: '654', username: 'usr5', webUrl: 'http://test.test/usr5', name: 'User 5', @@ -40,6 +45,22 @@ const approvalsRequired = 3; const groupsMock = [{ name: 'test_group_1' }, { name: 'test_group_2' }]; +export const approvalRulesMock = [ + { + __typename: 'ApprovalProjectRule', + id: '123', + name: 'test', + type: 'REGULAR', + eligibleApprovers: { nodes: usersMock }, + approvalsRequired, + }, +]; + +export const statusChecksRulesMock = [ + { __typename: 'StatusCheckRule', id: '123', name: 'test', externalUrl: 'https://test.test' }, + { __typename: 'StatusCheckRule', id: '456', name: 'test 2', externalUrl: 'https://test2.test2' }, +]; + export const protectionPropsMock = { header: 'Test protection', headerLinkTitle: 'Test link title', @@ -47,13 +68,8 @@ export const protectionPropsMock = { roles: accessLevelsMock, users: usersMock, groups: groupsMock, - approvals: [ - { - name: 'test', - eligibleApprovers: { nodes: usersMock }, - approvalsRequired, - }, - ], + approvals: approvalRulesMock, + statusChecks: statusChecksRulesMock, }; export const protectionRowPropsMock = { @@ -61,6 +77,7 @@ export const protectionRowPropsMock = { users: usersMock, accessLevels: accessLevelsMock, approvalsRequired, + statusCheckUrl: statusChecksRulesMock[0].externalUrl, }; export const accessLevelsMockResponse = [ @@ -116,6 +133,14 @@ export const branchProtectionsMockResponse = { edges: accessLevelsMockResponse, }, }, + approvalRules: { + __typename: 'ApprovalProjectRuleConnection', + nodes: approvalRulesMock, + }, + externalStatusChecks: { + __typename: 'ExternalStatusCheckConnection', + nodes: statusChecksRulesMock, + }, }, { __typename: 'BranchRule', @@ -133,6 +158,14 @@ export const branchProtectionsMockResponse = { edges: [], }, }, + approvalRules: { + __typename: 'ApprovalProjectRuleConnection', + nodes: [], + }, + externalStatusChecks: { + __typename: 'ExternalStatusCheckConnection', + nodes: [], + }, }, ], }, |