2022-11-25 23:54:43 +05:30
|
|
|
// Fixture located at spec/frontend/fixtures/pipeline_schedules.rb
|
|
|
|
import mockGetPipelineSchedulesGraphQLResponse from 'test_fixtures/graphql/pipeline_schedules/get_pipeline_schedules.query.graphql.json';
|
|
|
|
import mockGetPipelineSchedulesAsGuestGraphQLResponse from 'test_fixtures/graphql/pipeline_schedules/get_pipeline_schedules.query.graphql.as_guest.json';
|
2023-01-13 00:05:48 +05:30
|
|
|
import mockGetPipelineSchedulesTakeOwnershipGraphQLResponse from 'test_fixtures/graphql/pipeline_schedules/get_pipeline_schedules.query.graphql.take_ownership.json';
|
2022-11-25 23:54:43 +05:30
|
|
|
|
|
|
|
const {
|
|
|
|
data: {
|
|
|
|
project: {
|
|
|
|
pipelineSchedules: { nodes },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
} = mockGetPipelineSchedulesGraphQLResponse;
|
|
|
|
|
|
|
|
const {
|
|
|
|
data: {
|
|
|
|
project: {
|
|
|
|
pipelineSchedules: { nodes: guestNodes },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
} = mockGetPipelineSchedulesAsGuestGraphQLResponse;
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
const {
|
|
|
|
data: {
|
|
|
|
project: {
|
|
|
|
pipelineSchedules: { nodes: takeOwnershipNodes },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
} = mockGetPipelineSchedulesTakeOwnershipGraphQLResponse;
|
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
export const mockPipelineScheduleNodes = nodes;
|
|
|
|
|
|
|
|
export const mockPipelineScheduleAsGuestNodes = guestNodes;
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
export const mockTakeOwnershipNodes = takeOwnershipNodes;
|
2023-03-17 16:20:25 +05:30
|
|
|
export const emptyPipelineSchedulesResponse = {
|
|
|
|
data: {
|
|
|
|
project: {
|
|
|
|
id: 'gid://gitlab/Project/1',
|
|
|
|
pipelineSchedules: { nodes: [], count: 0 },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2023-01-13 00:05:48 +05:30
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
export const deleteMutationResponse = {
|
|
|
|
data: {
|
|
|
|
pipelineScheduleDelete: {
|
|
|
|
clientMutationId: null,
|
|
|
|
errors: [],
|
|
|
|
__typename: 'PipelineScheduleDeletePayload',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2023-03-17 16:20:25 +05:30
|
|
|
export const playMutationResponse = {
|
|
|
|
data: {
|
|
|
|
pipelineSchedulePlay: {
|
|
|
|
clientMutationId: null,
|
|
|
|
errors: [],
|
|
|
|
__typename: 'PipelineSchedulePlayPayload',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
export const takeOwnershipMutationResponse = {
|
|
|
|
data: {
|
|
|
|
pipelineScheduleTakeOwnership: {
|
|
|
|
pipelineSchedule: {
|
|
|
|
id: '1',
|
|
|
|
owner: {
|
|
|
|
id: '2',
|
|
|
|
name: 'Admin',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
errors: [],
|
|
|
|
__typename: 'PipelineScheduleTakeOwnershipPayload',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
export { mockGetPipelineSchedulesGraphQLResponse };
|