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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/commit/mock_data.js')
-rw-r--r--spec/frontend/commit/mock_data.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/spec/frontend/commit/mock_data.js b/spec/frontend/commit/mock_data.js
index 3b6971d9607..2a618e08c50 100644
--- a/spec/frontend/commit/mock_data.js
+++ b/spec/frontend/commit/mock_data.js
@@ -232,3 +232,62 @@ export const x509CertificateDetailsProp = {
subject: 'CN=gitlab@example.org,OU=Example,O=World',
subjectKeyIdentifier: 'BC BC BC BC BC BC BC BC',
};
+
+export const tippingBranchesMock = ['main', 'development'];
+
+export const containingBranchesMock = ['branch-1', 'branch-2', 'branch-3'];
+
+export const mockCommitReferencesResponse = {
+ data: {
+ project: {
+ id: 'gid://gitlab/Project/1',
+ commitReferences: {
+ containingBranches: { names: ['branch-1'], __typename: 'CommitParentNames' },
+ containingTags: { names: ['tag-1'], __typename: 'CommitParentNames' },
+ tippingBranches: { names: tippingBranchesMock, __typename: 'CommitParentNames' },
+ tippingTags: { names: ['tag-latest'], __typename: 'CommitParentNames' },
+ __typename: 'CommitReferences',
+ },
+ __typename: 'Project',
+ },
+ },
+};
+
+export const mockOnlyBranchesResponse = {
+ data: {
+ project: {
+ id: 'gid://gitlab/Project/1',
+ commitReferences: {
+ containingBranches: { names: ['branch-1'], __typename: 'CommitParentNames' },
+ containingTags: { names: [], __typename: 'CommitParentNames' },
+ tippingBranches: { names: tippingBranchesMock, __typename: 'CommitParentNames' },
+ tippingTags: { names: [], __typename: 'CommitParentNames' },
+ __typename: 'CommitReferences',
+ },
+ __typename: 'Project',
+ },
+ },
+};
+
+export const mockContainingBranchesResponse = {
+ data: {
+ project: {
+ id: 'gid://gitlab/Project/1',
+ commitReferences: {
+ containingBranches: { names: containingBranchesMock, __typename: 'CommitParentNames' },
+ __typename: 'CommitReferences',
+ },
+ __typename: 'Project',
+ },
+ },
+};
+
+export const refsListPropsMock = {
+ hasContainingRefs: true,
+ containingRefs: [],
+ namespace: 'Branches',
+ tippingRefs: tippingBranchesMock,
+ isLoading: false,
+ urlPart: '/some/project/-/commits/',
+ refType: 'heads',
+};