Commit 7d37748d authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'sh-fix-notification-toggles-epics-subgroups' into 'master'

Fix epic subscriptions not working for subgroups

Closes #197483

See merge request gitlab-org/gitlab!23283
parents 5cd08b0e 4fd56ebf
......@@ -189,7 +189,7 @@ export const toggleEpicSubscription = ({ state, dispatch }) => {
variables: {
epicSetSubscriptionInput: {
iid: `${state.epicIid}`,
groupPath: state.groupPath,
groupPath: state.fullPath,
subscribedState: !state.subscribed,
},
},
......
......@@ -3,6 +3,7 @@ export default () => ({
endpoint: '',
updateEndpoint: '',
fullPath: '',
groupPath: '',
markdownPreviewPath: '',
labelsPath: '',
......
......@@ -776,11 +776,15 @@ describe('Epic Store Actions', () => {
__typename: 'EpicSetSubscriptionPayload',
},
};
const stateSubscribed = {
subscribed: false,
};
beforeEach(() => {
Object.assign(state, {
epicIid: 123,
groupPath: 'charts',
fullPath: 'gitlab-org/charts',
subscribed: false,
});
mock = new MockAdapter(axios);
});
......@@ -799,8 +803,8 @@ describe('Epic Store Actions', () => {
testAction(
actions.toggleEpicSubscription,
{ subscribed: !stateSubscribed.subscribed },
stateSubscribed,
{ subscribed: !state.subscribed },
state,
[],
[
{
......@@ -808,10 +812,24 @@ describe('Epic Store Actions', () => {
},
{
type: 'requestEpicSubscriptionToggleSuccess',
payload: { subscribed: !stateSubscribed.subscribed },
payload: { subscribed: !state.subscribed },
},
],
done,
() => {
expect(epicUtils.gqClient.mutate).toHaveBeenCalledWith(
jasmine.objectContaining({
variables: jasmine.objectContaining({
epicSetSubscriptionInput: {
iid: `${state.epicIid}`,
groupPath: state.fullPath,
subscribedState: !state.subscribed,
},
}),
}),
);
done();
},
);
});
});
......@@ -832,8 +850,8 @@ describe('Epic Store Actions', () => {
testAction(
actions.toggleEpicSubscription,
{ subscribed: !stateSubscribed.subscribed },
stateSubscribed,
{ subscribed: !state.subscribed },
state,
[],
[
{
......
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