summaryrefslogtreecommitdiff
path: root/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/pages/projects/forks/new/components/fork_form_spec.js')
-rw-r--r--spec/frontend/pages/projects/forks/new/components/fork_form_spec.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js b/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js
index 9718d847ed5..aee56247209 100644
--- a/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js
+++ b/spec/frontend/pages/projects/forks/new/components/fork_form_spec.js
@@ -33,6 +33,7 @@ describe('ForkForm component', () => {
const DEFAULT_PROVIDE = {
newGroupPath: 'some/groups/path',
visibilityHelpPath: 'some/visibility/help/path',
+ cancelPath: '/some/project-full-path',
projectFullPath: '/some/project-full-path',
projectId: '10',
projectName: 'Project Name',
@@ -124,13 +125,13 @@ describe('ForkForm component', () => {
const findVisibilityRadioGroup = () =>
wrapper.find('[data-testid="fork-visibility-radio-group"]');
- it('will go to projectFullPath when click cancel button', () => {
+ it('will go to cancelPath when click cancel button', () => {
createComponent();
- const { projectFullPath } = DEFAULT_PROVIDE;
+ const { cancelPath } = DEFAULT_PROVIDE;
const cancelButton = wrapper.find('[data-testid="cancel-button"]');
- expect(cancelButton.attributes('href')).toBe(projectFullPath);
+ expect(cancelButton.attributes('href')).toBe(cancelPath);
});
const selectedMockNamespace = {
@@ -463,16 +464,12 @@ describe('ForkForm component', () => {
expect(urlUtility.redirectTo).not.toHaveBeenCalled();
});
- it('does not make POST request if no visbility is checked', async () => {
+ it('does not make POST request if no visibility is checked', async () => {
jest.spyOn(axios, 'post');
- setupComponent({
- fields: {
- visibility: {
- value: null,
- },
- },
- });
+ setupComponent();
+ wrapper.vm.form.fields.visibility.value = null;
+ await nextTick();
await submitForm();