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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-20 12:18:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-20 12:18:59 +0300
commitc7eec01f1b68b2e047cdd709751cb695ab329933 (patch)
tree47609cd0e5f00afdd1532cf951f9c0055a125641 /spec/frontend/repository
parent9b863f753f0320a95af1ff774cd0c1d4ec7d2754 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/repository')
-rw-r--r--spec/frontend/repository/components/fork_info_spec.js11
-rw-r--r--spec/frontend/repository/mock_data.js1
2 files changed, 9 insertions, 3 deletions
diff --git a/spec/frontend/repository/components/fork_info_spec.js b/spec/frontend/repository/components/fork_info_spec.js
index 8521f91a6c7..62a66e59d24 100644
--- a/spec/frontend/repository/components/fork_info_spec.js
+++ b/spec/frontend/repository/components/fork_info_spec.js
@@ -86,6 +86,7 @@ describe('ForkInfo component', () => {
const findIcon = () => wrapper.findComponent(GlIcon);
const findUpdateForkButton = () => wrapper.findByTestId('update-fork-button');
const findCreateMrButton = () => wrapper.findByTestId('create-mr-button');
+ const findViewMrButton = () => wrapper.findByTestId('view-mr-button');
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
const findDivergenceMessage = () => wrapper.findByTestId('divergence-message');
const findInaccessibleMessage = () => wrapper.findByTestId('inaccessible-project');
@@ -145,8 +146,14 @@ describe('ForkInfo component', () => {
expect(findCreateMrButton().attributes('href')).toBe(propsForkInfo.createMrPath);
});
- it('does not render create MR button if user had no permission to Create MR in fork', async () => {
- await createComponent({ canUserCreateMrInFork: false });
+ it('renders View MR Button with correct path', async () => {
+ const viewMrPath = 'path/to/view/mr';
+ await createComponent({ viewMrPath });
+ expect(findViewMrButton().attributes('href')).toBe(viewMrPath);
+ });
+
+ it('does not render create MR button if create MR path is blank', async () => {
+ await createComponent({ createMrPath: '' });
expect(findCreateMrButton().exists()).toBe(false);
});
diff --git a/spec/frontend/repository/mock_data.js b/spec/frontend/repository/mock_data.js
index afa183c0616..a8768e2a825 100644
--- a/spec/frontend/repository/mock_data.js
+++ b/spec/frontend/repository/mock_data.js
@@ -127,7 +127,6 @@ export const propsForkInfo = {
aheadComparePath: '/nataliia/myGitLab/-/compare/main...ref?from_project_id=1',
behindComparePath: 'gitlab-org/gitlab/-/compare/ref...main?from_project_id=2',
createMrPath: 'path/to/new/mr',
- canUserCreateMrInFork: true,
};
export const propsConflictsModal = {