Commit 0c50654e authored by jakeburden's avatar jakeburden

Add tests for the “assign commenting user” button

parent 2c6ec196
......@@ -127,7 +127,13 @@ describe('noteActions', () => {
.catch(done.fail);
});
it('should be possible to assign or unassign the comment author', () => {
it('should be possible to assign or unassign the comment author if the user has access to edit an issue', () => {
store.dispatch('setNoteableData', {
current_user: {
can_update: true,
},
});
wrapper = shallowMountNoteActions(props, {
targetType: () => 'issue',
});
......@@ -141,6 +147,11 @@ describe('noteActions', () => {
});
});
it('should not be possible to assign or unassign the comment author if the user does not have access to edit an issue', () => {
const assignUserButton = wrapper.find('[data-testid="assign-user"]');
expect(assignUserButton.exists()).toBe(false);
});
it('should not be possible to assign or unassign the comment author in a merge request', () => {
const assignUserButton = wrapper.find('[data-testid="assign-user"]');
expect(assignUserButton.exists()).toBe(false);
......
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