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/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions_spec.js')
-rw-r--r--spec/frontend/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions_spec.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/frontend/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions_spec.js b/spec/frontend/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions_spec.js
index be0052fc7cf..5eca355fcf4 100644
--- a/spec/frontend/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions_spec.js
+++ b/spec/frontend/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions_spec.js
@@ -1,6 +1,7 @@
import { GlButton } from '@gitlab/ui';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import PipelineScheduleActions from '~/ci/pipeline_schedules/components/table/cells/pipeline_schedule_actions.vue';
+import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import {
mockPipelineScheduleNodes,
mockPipelineScheduleCurrentUser,
@@ -28,6 +29,7 @@ describe('Pipeline schedule actions', () => {
const findDeleteBtn = () => wrapper.findByTestId('delete-pipeline-schedule-btn');
const findTakeOwnershipBtn = () => wrapper.findByTestId('take-ownership-pipeline-schedule-btn');
const findPlayScheduleBtn = () => wrapper.findByTestId('play-pipeline-schedule-btn');
+ const findEditScheduleBtn = () => wrapper.findByTestId('edit-pipeline-schedule-btn');
it('displays buttons when user is the owner of schedule and has adminPipelineSchedule permissions', () => {
createComponent();
@@ -76,4 +78,15 @@ describe('Pipeline schedule actions', () => {
playPipelineSchedule: [[mockPipelineScheduleNodes[0].id]],
});
});
+
+ it('edit button links to edit schedule path', () => {
+ createComponent();
+
+ const { schedule } = defaultProps;
+ const id = getIdFromGraphQLId(schedule.id);
+
+ const expectedPath = `${schedule.editPath}?id=${id}`;
+
+ expect(findEditScheduleBtn().attributes('href')).toBe(expectedPath);
+ });
});