Commit 88fae32d authored by Florie Guibert's avatar Florie Guibert

Boards - Fix subgroup path

Remove broken group path getter for subgroups.
parent 6f0bab97
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
groupPathForActiveIssue: (_, getters) => { groupPathForActiveIssue: (_, getters) => {
const { referencePath = '' } = getters.activeBoardItem; const { referencePath = '' } = getters.activeBoardItem;
return referencePath.slice(0, referencePath.indexOf('/')); return referencePath.slice(0, referencePath.lastIndexOf('/'));
}, },
projectPathForActiveIssue: (_, getters) => { projectPathForActiveIssue: (_, getters) => {
......
...@@ -110,6 +110,15 @@ describe('Boards - Getters', () => { ...@@ -110,6 +110,15 @@ describe('Boards - Getters', () => {
); );
}); });
it('returns group path of last subgroup for the active issue', () => {
const mockActiveIssue = {
referencePath: 'gitlab-org/subgroup/subsubgroup/gitlab-test#1',
};
expect(getters.groupPathForActiveIssue({}, { activeBoardItem: mockActiveIssue })).toEqual(
'gitlab-org/subgroup/subsubgroup',
);
});
it('returns empty string as group path when active issue is an empty object', () => { it('returns empty string as group path when active issue is an empty object', () => {
const mockActiveIssue = {}; const mockActiveIssue = {};
expect(getters.groupPathForActiveIssue({}, { activeBoardItem: mockActiveIssue })).toEqual(''); expect(getters.groupPathForActiveIssue({}, { activeBoardItem: mockActiveIssue })).toEqual('');
......
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