Commit 24e847af authored by Simon Knox's avatar Simon Knox

Remove some dead code

Usage of getters was removed in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/19827
parent 22065fbe
import { issuableTypesMap, PathIdSeparator } from 'ee/related_issues/constants';
import { ChildType } from '../constants';
export const autoCompleteSources = () => gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources;
......@@ -8,21 +7,6 @@ export const directChildren = state => state.children[state.parentItem.reference
export const anyParentHasChildren = (state, getters) =>
getters.directChildren.some(item => item.hasChildren || item.hasIssues);
export const headerItems = state => [
{
iconName: 'epic',
count: state.epicsCount,
qaClass: 'qa-add-epics-button',
type: ChildType.Epic,
},
{
iconName: 'issues',
count: state.issuesCount,
qaClass: 'qa-add-issues-button',
type: ChildType.Issue,
},
];
export const itemAutoCompleteSources = (state, getters) => {
if (getters.isEpic) {
return state.autoCompleteEpics ? getters.autoCompleteSources : {};
......
import * as getters from 'ee/related_items_tree/store/getters';
import createDefaultState from 'ee/related_items_tree/store/state';
import { issuableTypesMap } from 'ee/related_issues/constants';
import { ChildType } from 'ee/related_items_tree/constants';
import { mockEpic1, mockEpic2 } from '../../../javascripts/related_items_tree/mock_data';
......@@ -60,36 +57,6 @@ describe('RelatedItemsTree', () => {
});
});
describe('headerItems', () => {
it('returns an item within array containing Epic iconName, count, qaClass & type props', () => {
state.epicsCount = 2;
const epicHeaderItem = getters.headerItems(state)[0];
expect(epicHeaderItem).toEqual(
expect.objectContaining({
iconName: 'epic',
count: 2,
qaClass: 'qa-add-epics-button',
type: ChildType.Epic,
}),
);
});
it('returns an item within array containing Issue iconName, count, qaClass & type props', () => {
state.issuesCount = 2;
const epicHeaderItem = getters.headerItems(state)[1];
expect(epicHeaderItem).toEqual(
expect.objectContaining({
iconName: 'issues',
count: 2,
qaClass: 'qa-add-issues-button',
type: ChildType.Issue,
}),
);
});
});
describe('itemAutoCompleteSources', () => {
it('returns autoCompleteSources value when `issuableType` is set to `Epic` and `autoCompleteEpics` is true', () => {
const mockGetter = {
......
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