Commit 4e40d422 authored by Enrique Alcántara's avatar Enrique Alcántara

Merge branch 'ek-remove-unused-vsa-code' into 'master'

Removes unused VSA properties

See merge request gitlab-org/gitlab!82559
parents 5e7a08fa 9cd5e8bd
......@@ -18,7 +18,7 @@ import {
PAGINATION_SORT_DIRECTION_ASC,
PAGINATION_SORT_DIRECTION_DESC,
} from '../constants';
import TotalTime from './total_time_component.vue';
import TotalTime from './total_time.vue';
const DEFAULT_WORKFLOW_TITLE_PROPERTIES = {
thClass: 'gl-w-half',
......
......@@ -61,7 +61,6 @@ export default {
'currentGroupPath',
'activeStages',
'selectedProjectIds',
'enableCustomOrdering',
'cycleAnalyticsRequestParams',
'pathNavigationData',
'isOverviewStageSelected',
......
import dateFormat from 'dateformat';
import { isNumber } from 'lodash';
import { dateFormats } from '~/analytics/shared/constants';
import { OVERVIEW_STAGE_ID } from '~/cycle_analytics/constants';
import {
......@@ -54,9 +53,6 @@ export const paginationParams = basePaginationParams;
export const hiddenStages = ({ stages }) => filterStagesByHiddenStatus(stages);
export const activeStages = ({ stages }) => filterStagesByHiddenStatus(stages, false);
export const enableCustomOrdering = ({ stages, errorSavingStageOrder }) =>
stages.some((stage) => isNumber(stage.id)) && !errorSavingStageOrder;
export const customStageFormActive = ({ isCreatingCustomStage, isEditingCustomStage }) =>
Boolean(isCreatingCustomStage || isEditingCustomStage);
......
......@@ -152,44 +152,6 @@ describe('Value Stream Analytics getters', () => {
});
});
describe('enableCustomOrdering', () => {
describe('with no errors saving the stage order', () => {
beforeEach(() => {
state = {
errorSavingStageOrder: false,
};
});
it('returns true when stages have numeric IDs', () => {
state.stages = [{ id: 1 }, { id: 2 }];
expect(getters.enableCustomOrdering(state)).toEqual(true);
});
it('returns false when stages have string based IDs', () => {
state.stages = [{ id: 'one' }, { id: 'two' }];
expect(getters.enableCustomOrdering(state)).toEqual(false);
});
});
describe('with errors saving the stage order', () => {
beforeEach(() => {
state = {
errorSavingStageOrder: true,
};
});
it('returns false when stages have numeric IDs', () => {
state.stages = [{ id: 1 }, { id: 2 }];
expect(getters.enableCustomOrdering(state)).toEqual(false);
});
it('returns false when stages have string based IDs', () => {
state.stages = [{ id: 'one' }, { id: 'two' }];
expect(getters.enableCustomOrdering(state)).toEqual(false);
});
});
});
describe.each`
isEditingCustomStage | isCreatingCustomStage | result
${true} | ${true} | ${true}
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`TotalTimeComponent with a blank object should render -- 1`] = `"<span class=\\"total-time\\"> -- </span>"`;
exports[`TotalTime with a blank object should render -- 1`] = `"<span class=\\"total-time\\"> -- </span>"`;
exports[`TotalTimeComponent with a valid time object with {"days": 3, "mins": 47, "seconds": 3} 1`] = `
exports[`TotalTime with a valid time object with {"days": 3, "mins": 47, "seconds": 3} 1`] = `
"<span class=\\"total-time\\">
3 <span>days</span></span>"
`;
exports[`TotalTimeComponent with a valid time object with {"hours": 7, "mins": 20, "seconds": 10} 1`] = `
exports[`TotalTime with a valid time object with {"hours": 7, "mins": 20, "seconds": 10} 1`] = `
"<span class=\\"total-time\\">
7 <span>hrs</span></span>"
`;
exports[`TotalTimeComponent with a valid time object with {"hours": 23, "mins": 10} 1`] = `
exports[`TotalTime with a valid time object with {"hours": 23, "mins": 10} 1`] = `
"<span class=\\"total-time\\">
23 <span>hrs</span></span>"
`;
exports[`TotalTimeComponent with a valid time object with {"mins": 47, "seconds": 3} 1`] = `
exports[`TotalTime with a valid time object with {"mins": 47, "seconds": 3} 1`] = `
"<span class=\\"total-time\\">
47 <span>mins</span></span>"
`;
exports[`TotalTimeComponent with a valid time object with {"seconds": 35} 1`] = `
exports[`TotalTime with a valid time object with {"seconds": 35} 1`] = `
"<span class=\\"total-time\\">
35 <span>s</span></span>"
`;
import { mount } from '@vue/test-utils';
import TotalTimeComponent from '~/cycle_analytics/components/total_time_component.vue';
import TotalTime from '~/cycle_analytics/components/total_time.vue';
describe('TotalTimeComponent', () => {
describe('TotalTime', () => {
let wrapper = null;
const createComponent = (propsData) => {
return mount(TotalTimeComponent, {
return mount(TotalTime, {
propsData,
});
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment