summaryrefslogtreecommitdiff
path: root/spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js')
-rw-r--r--spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js19
1 files changed, 5 insertions, 14 deletions
diff --git a/spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js b/spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js
index 2cdb971395d..5bac1d6e7ad 100644
--- a/spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js
+++ b/spec/frontend/issues/show/components/incidents/timeline_events_tab_spec.js
@@ -36,7 +36,7 @@ describe('TimelineEventsTab', () => {
provide: {
fullPath: 'group/project',
issuableId: '1',
- canUpdate: true,
+ canUpdateTimelineEvent: true,
...provide,
},
apolloProvider: mockApollo,
@@ -136,29 +136,20 @@ describe('TimelineEventsTab', () => {
it('should not show a button when user cannot update', () => {
mountComponent({
mockApollo: createMockApolloProvider(emptyResponse),
- provide: { canUpdate: false },
+ provide: { canUpdateTimelineEvent: false },
});
expect(findAddEventButton().exists()).toBe(false);
});
it('should not show a form by default', () => {
- expect(findCreateTimelineEvent().isVisible()).toBe(false);
+ expect(findCreateTimelineEvent().exists()).toBe(false);
});
it('should show a form when button is clicked', async () => {
await findAddEventButton().trigger('click');
- expect(findCreateTimelineEvent().isVisible()).toBe(true);
- });
-
- it('should clear the form when button is clicked', async () => {
- const mockClear = jest.fn();
- wrapper.vm.$refs.createEventForm.clearForm = mockClear;
-
- await findAddEventButton().trigger('click');
-
- expect(mockClear).toHaveBeenCalled();
+ expect(findCreateTimelineEvent().exists()).toBe(true);
});
it('should hide the form when the hide event is emitted', async () => {
@@ -167,7 +158,7 @@ describe('TimelineEventsTab', () => {
await findCreateTimelineEvent().vm.$emit('hide-new-timeline-events-form');
- expect(findCreateTimelineEvent().isVisible()).toBe(false);
+ expect(findCreateTimelineEvent().exists()).toBe(false);
});
});
});