Commit 6d92d439 authored by Vitaly Slobodin's avatar Vitaly Slobodin Committed by Natalia Tepluhina

Replace jasmine functions in EE Jest specs

Replace Jasmine globals with Jest equivalents and
disallow further usage of Jasmine global in Jest specs.
parent 1b238d9b
--- ---
extends: ../../../spec/frontend/.eslintrc.yml extends: ../../../spec/frontend/.eslintrc.yml
rules: rules:
jest/no-jasmine-globals: off
jest/valid-describe: off jest/valid-describe: off
...@@ -45,7 +45,7 @@ describe('Api', () => { ...@@ -45,7 +45,7 @@ describe('Api', () => {
it('calls callback on completion', done => { it('calls callback on completion', done => {
const query = 'query'; const query = 'query';
const provider = 'provider'; const provider = 'provider';
const callback = jasmine.createSpy(); const callback = jest.fn();
const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/ldap/${provider}/groups.json`; const expectedUrl = `${dummyUrlRoot}/api/${dummyApiVersion}/ldap/${provider}/groups.json`;
mock.onGet(expectedUrl).reply(200, [ mock.onGet(expectedUrl).reply(200, [
......
...@@ -50,7 +50,7 @@ describe('Approvals ModalRuleRemove', () => { ...@@ -50,7 +50,7 @@ describe('Approvals ModalRuleRemove', () => {
data: TEST_RULE, data: TEST_RULE,
}; };
actions = { actions = {
deleteRule: jasmine.createSpy('deleteRule'), deleteRule: jest.fn(),
}; };
}); });
...@@ -61,7 +61,7 @@ describe('Approvals ModalRuleRemove', () => { ...@@ -61,7 +61,7 @@ describe('Approvals ModalRuleRemove', () => {
expect(modal.exists()).toBe(true); expect(modal.exists()).toBe(true);
expect(modal.props()).toEqual( expect(modal.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
modalModule: MODAL_MODULE, modalModule: MODAL_MODULE,
modalId: TEST_MODAL_ID, modalId: TEST_MODAL_ID,
}), }),
...@@ -97,6 +97,6 @@ describe('Approvals ModalRuleRemove', () => { ...@@ -97,6 +97,6 @@ describe('Approvals ModalRuleRemove', () => {
const modal = wrapper.find(GlModalVuex); const modal = wrapper.find(GlModalVuex);
modal.vm.$emit('ok', new Event('submit')); modal.vm.$emit('ok', new Event('submit'));
expect(actions.deleteRule).toHaveBeenCalledWith(jasmine.anything(), TEST_RULE.id, undefined); expect(actions.deleteRule).toHaveBeenCalledWith(expect.anything(), TEST_RULE.id, undefined);
}); });
}); });
...@@ -32,7 +32,7 @@ describe('EE approvals base module mutations', () => { ...@@ -32,7 +32,7 @@ describe('EE approvals base module mutations', () => {
mutations[types.SET_APPROVAL_SETTINGS](state, settings); mutations[types.SET_APPROVAL_SETTINGS](state, settings);
expect(state).toEqual(jasmine.objectContaining(settings)); expect(state).toEqual(expect.objectContaining(settings));
}); });
}); });
}); });
...@@ -64,7 +64,7 @@ describe('EpicCreateComponent', () => { ...@@ -64,7 +64,7 @@ describe('EpicCreateComponent', () => {
vm.epicTitle = newEpicTitle; vm.epicTitle = newEpicTitle;
expect(vm.setEpicCreateTitle).toHaveBeenCalledWith( expect(vm.setEpicCreateTitle).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
newEpicTitle, newEpicTitle,
}), }),
); );
......
...@@ -39,7 +39,7 @@ describe('EpicSidebarComponent', () => { ...@@ -39,7 +39,7 @@ describe('EpicSidebarComponent', () => {
vm.getDateFromMilestonesTooltip(dateTypes.start); vm.getDateFromMilestonesTooltip(dateTypes.start);
expect(epicUtils.getDateFromMilestonesTooltip).toHaveBeenCalledWith( expect(epicUtils.getDateFromMilestonesTooltip).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
dateType: dateTypes.start, dateType: dateTypes.start,
}), }),
); );
...@@ -53,7 +53,7 @@ describe('EpicSidebarComponent', () => { ...@@ -53,7 +53,7 @@ describe('EpicSidebarComponent', () => {
vm.changeStartDateType(true, true); vm.changeStartDateType(true, true);
expect(vm.toggleStartDateType).toHaveBeenCalledWith( expect(vm.toggleStartDateType).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
dateTypeIsFixed: true, dateTypeIsFixed: true,
}), }),
); );
...@@ -65,7 +65,7 @@ describe('EpicSidebarComponent', () => { ...@@ -65,7 +65,7 @@ describe('EpicSidebarComponent', () => {
vm.changeStartDateType(true, false); vm.changeStartDateType(true, false);
expect(vm.saveDate).toHaveBeenCalledWith( expect(vm.saveDate).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
dateTypeIsFixed: true, dateTypeIsFixed: true,
dateType: dateTypes.start, dateType: dateTypes.start,
newDate: '2018-06-01', newDate: '2018-06-01',
...@@ -81,7 +81,7 @@ describe('EpicSidebarComponent', () => { ...@@ -81,7 +81,7 @@ describe('EpicSidebarComponent', () => {
vm.saveStartDate('2018-1-1'); vm.saveStartDate('2018-1-1');
expect(vm.saveDate).toHaveBeenCalledWith( expect(vm.saveDate).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
dateTypeIsFixed: true, dateTypeIsFixed: true,
dateType: dateTypes.start, dateType: dateTypes.start,
newDate: '2018-1-1', newDate: '2018-1-1',
...@@ -97,7 +97,7 @@ describe('EpicSidebarComponent', () => { ...@@ -97,7 +97,7 @@ describe('EpicSidebarComponent', () => {
vm.changeDueDateType(true, true); vm.changeDueDateType(true, true);
expect(vm.toggleDueDateType).toHaveBeenCalledWith( expect(vm.toggleDueDateType).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
dateTypeIsFixed: true, dateTypeIsFixed: true,
}), }),
); );
...@@ -109,7 +109,7 @@ describe('EpicSidebarComponent', () => { ...@@ -109,7 +109,7 @@ describe('EpicSidebarComponent', () => {
vm.changeDueDateType(true, false); vm.changeDueDateType(true, false);
expect(vm.saveDate).toHaveBeenCalledWith( expect(vm.saveDate).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
dateTypeIsFixed: true, dateTypeIsFixed: true,
dateType: dateTypes.due, dateType: dateTypes.due,
newDate: '2018-08-01', newDate: '2018-08-01',
...@@ -125,7 +125,7 @@ describe('EpicSidebarComponent', () => { ...@@ -125,7 +125,7 @@ describe('EpicSidebarComponent', () => {
vm.saveDueDate('2018-1-1'); vm.saveDueDate('2018-1-1');
expect(vm.saveDate).toHaveBeenCalledWith( expect(vm.saveDate).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
dateTypeIsFixed: true, dateTypeIsFixed: true,
dateType: dateTypes.due, dateType: dateTypes.due,
newDate: '2018-1-1', newDate: '2018-1-1',
......
...@@ -54,7 +54,7 @@ describe('SidebarLabelsComponent', () => { ...@@ -54,7 +54,7 @@ describe('SidebarLabelsComponent', () => {
wrapper.vm.toggleSidebarRevealLabelsDropdown(); wrapper.vm.toggleSidebarRevealLabelsDropdown();
expect(wrapper.vm.toggleSidebar).toHaveBeenCalledWith( expect(wrapper.vm.toggleSidebar).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
sidebarCollapsed: false, sidebarCollapsed: false,
}), }),
); );
...@@ -73,7 +73,7 @@ describe('SidebarLabelsComponent', () => { ...@@ -73,7 +73,7 @@ describe('SidebarLabelsComponent', () => {
expect(wrapper.vm.sidebarExpandedOnClick).toBe(false); expect(wrapper.vm.sidebarExpandedOnClick).toBe(false);
expect(wrapper.vm.toggleSidebar).toHaveBeenCalledWith( expect(wrapper.vm.toggleSidebar).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
sidebarCollapsed: false, sidebarCollapsed: false,
}), }),
); );
......
...@@ -1055,8 +1055,8 @@ describe('Epic Store Actions', () => { ...@@ -1055,8 +1055,8 @@ describe('Epic Store Actions', () => {
], ],
() => { () => {
expect(epicUtils.gqClient.mutate).toHaveBeenCalledWith( expect(epicUtils.gqClient.mutate).toHaveBeenCalledWith(
jasmine.objectContaining({ expect.objectContaining({
variables: jasmine.objectContaining({ variables: expect.objectContaining({
epicSetSubscriptionInput: { epicSetSubscriptionInput: {
iid: `${state.epicIid}`, iid: `${state.epicIid}`,
groupPath: state.fullPath, groupPath: state.fullPath,
......
...@@ -152,7 +152,7 @@ describe('AppComponent', () => { ...@@ -152,7 +152,7 @@ describe('AppComponent', () => {
vm.fetchNodeDetails(mockNode) vm.fetchNodeDetails(mockNode)
.then(() => { .then(() => {
expect(eventHub.$emit).toHaveBeenCalledWith('nodeDetailsLoaded', jasmine.any(Object)); expect(eventHub.$emit).toHaveBeenCalledWith('nodeDetailsLoaded', expect.any(Object));
const nodeDetails = vm.store.state.nodeDetails['1']; const nodeDetails = vm.store.state.nodeDetails['1'];
expect(nodeDetails).toBeDefined(); expect(nodeDetails).toBeDefined();
...@@ -169,7 +169,7 @@ describe('AppComponent', () => { ...@@ -169,7 +169,7 @@ describe('AppComponent', () => {
vm.fetchNodeDetails(mockNode) vm.fetchNodeDetails(mockNode)
.then(() => { .then(() => {
expect(eventHub.$emit).toHaveBeenCalledWith('nodeDetailsLoaded', jasmine.any(Object)); expect(eventHub.$emit).toHaveBeenCalledWith('nodeDetailsLoaded', expect.any(Object));
const nodeDetails = vm.store.state.nodeDetails['1']; const nodeDetails = vm.store.state.nodeDetails['1'];
expect(nodeDetails).toBeDefined(); expect(nodeDetails).toBeDefined();
...@@ -186,7 +186,7 @@ describe('AppComponent', () => { ...@@ -186,7 +186,7 @@ describe('AppComponent', () => {
vm.fetchNodeDetails(mockNode) vm.fetchNodeDetails(mockNode)
.then(() => { .then(() => {
expect(eventHub.$emit).toHaveBeenCalledWith('nodeDetailsLoaded', jasmine.any(Object)); expect(eventHub.$emit).toHaveBeenCalledWith('nodeDetailsLoaded', expect.any(Object));
const nodeDetails = vm.store.state.nodeDetails['1']; const nodeDetails = vm.store.state.nodeDetails['1'];
expect(nodeDetails).toBeDefined(); expect(nodeDetails).toBeDefined();
...@@ -476,9 +476,9 @@ describe('AppComponent', () => { ...@@ -476,9 +476,9 @@ describe('AppComponent', () => {
it('binds event handler for `pollNodeDetails`', () => { it('binds event handler for `pollNodeDetails`', () => {
const vmX = createComponent(); const vmX = createComponent();
expect(eventHub.$on).toHaveBeenCalledWith('pollNodeDetails', jasmine.any(Function)); expect(eventHub.$on).toHaveBeenCalledWith('pollNodeDetails', expect.any(Function));
expect(eventHub.$on).toHaveBeenCalledWith('showNodeActionModal', jasmine.any(Function)); expect(eventHub.$on).toHaveBeenCalledWith('showNodeActionModal', expect.any(Function));
expect(eventHub.$on).toHaveBeenCalledWith('repairNode', jasmine.any(Function)); expect(eventHub.$on).toHaveBeenCalledWith('repairNode', expect.any(Function));
vmX.$destroy(); vmX.$destroy();
}); });
}); });
...@@ -488,9 +488,9 @@ describe('AppComponent', () => { ...@@ -488,9 +488,9 @@ describe('AppComponent', () => {
const vmX = createComponent(); const vmX = createComponent();
vmX.$destroy(); vmX.$destroy();
expect(eventHub.$off).toHaveBeenCalledWith('pollNodeDetails', jasmine.any(Function)); expect(eventHub.$off).toHaveBeenCalledWith('pollNodeDetails', expect.any(Function));
expect(eventHub.$off).toHaveBeenCalledWith('showNodeActionModal', jasmine.any(Function)); expect(eventHub.$off).toHaveBeenCalledWith('showNodeActionModal', expect.any(Function));
expect(eventHub.$off).toHaveBeenCalledWith('repairNode', jasmine.any(Function)); expect(eventHub.$off).toHaveBeenCalledWith('repairNode', expect.any(Function));
}); });
}); });
......
...@@ -130,7 +130,7 @@ describe('GeoNodeItemComponent', () => { ...@@ -130,7 +130,7 @@ describe('GeoNodeItemComponent', () => {
describe('created', () => { describe('created', () => {
it('binds `nodeDetailsLoaded` event handler', () => { it('binds `nodeDetailsLoaded` event handler', () => {
expect(eventHub.$on).toHaveBeenCalledWith('nodeDetailsLoaded', jasmine.any(Function)); expect(eventHub.$on).toHaveBeenCalledWith('nodeDetailsLoaded', expect.any(Function));
}); });
}); });
...@@ -138,7 +138,7 @@ describe('GeoNodeItemComponent', () => { ...@@ -138,7 +138,7 @@ describe('GeoNodeItemComponent', () => {
it('unbinds `nodeDetailsLoaded` event handler', () => { it('unbinds `nodeDetailsLoaded` event handler', () => {
wrapper.destroy(); wrapper.destroy();
expect(eventHub.$off).toHaveBeenCalledWith('nodeDetailsLoaded', jasmine.any(Function)); expect(eventHub.$off).toHaveBeenCalledWith('nodeDetailsLoaded', expect.any(Function));
}); });
}); });
......
...@@ -79,7 +79,7 @@ describe('GroupMemberStore', () => { ...@@ -79,7 +79,7 @@ describe('GroupMemberStore', () => {
.fetchContributedMembers() .fetchContributedMembers()
.then(() => { .then(() => {
expect(store.isLoading).toBe(false); expect(store.isLoading).toBe(false);
expect(store.setColumns).toHaveBeenCalledWith(jasmine.any(Object)); expect(store.setColumns).toHaveBeenCalledWith(expect.any(Object));
expect(store.setMembers).toHaveBeenCalledWith(rawMembers); expect(store.setMembers).toHaveBeenCalledWith(rawMembers);
done(); done();
}) })
......
...@@ -38,7 +38,7 @@ describe('IDE EERightPane', () => { ...@@ -38,7 +38,7 @@ describe('IDE EERightPane', () => {
factory(); factory();
expect(wrapper.find(RightPane).props('extensionTabs')).toEqual([ expect(wrapper.find(RightPane).props('extensionTabs')).toEqual([
jasmine.objectContaining({ expect.objectContaining({
show: true, show: true,
title: 'Terminal', title: 'Terminal',
}), }),
...@@ -51,7 +51,7 @@ describe('IDE EERightPane', () => { ...@@ -51,7 +51,7 @@ describe('IDE EERightPane', () => {
factory(); factory();
expect(wrapper.find(RightPane).props('extensionTabs')).toEqual([ expect(wrapper.find(RightPane).props('extensionTabs')).toEqual([
jasmine.objectContaining({ expect.objectContaining({
show: false, show: false,
title: 'Terminal', title: 'Terminal',
}), }),
......
...@@ -37,8 +37,8 @@ describe('EE IDE TerminalSession', () => { ...@@ -37,8 +37,8 @@ describe('EE IDE TerminalSession', () => {
session: { status: RUNNING, terminalPath: TEST_TERMINAL_PATH }, session: { status: RUNNING, terminalPath: TEST_TERMINAL_PATH },
}; };
actions = { actions = {
restartSession: jasmine.createSpy('restartSession'), restartSession: jest.fn(),
stopSession: jasmine.createSpy('stopSession'), stopSession: jest.fn(),
}; };
}); });
......
...@@ -18,8 +18,8 @@ describe('EE IDE TerminalControls', () => { ...@@ -18,8 +18,8 @@ describe('EE IDE TerminalControls', () => {
factory(); factory();
expect(buttons.wrappers.map(x => x.props())).toEqual([ expect(buttons.wrappers.map(x => x.props())).toEqual([
jasmine.objectContaining({ direction: 'up', disabled: true }), expect.objectContaining({ direction: 'up', disabled: true }),
jasmine.objectContaining({ direction: 'down', disabled: true }), expect.objectContaining({ direction: 'down', disabled: true }),
]); ]);
}); });
...@@ -27,7 +27,7 @@ describe('EE IDE TerminalControls', () => { ...@@ -27,7 +27,7 @@ describe('EE IDE TerminalControls', () => {
factory({ propsData: { canScrollUp: true } }); factory({ propsData: { canScrollUp: true } });
expect(buttons.at(0).props()).toEqual( expect(buttons.at(0).props()).toEqual(
jasmine.objectContaining({ direction: 'up', disabled: false }), expect.objectContaining({ direction: 'up', disabled: false }),
); );
}); });
...@@ -35,7 +35,7 @@ describe('EE IDE TerminalControls', () => { ...@@ -35,7 +35,7 @@ describe('EE IDE TerminalControls', () => {
factory({ propsData: { canScrollDown: true } }); factory({ propsData: { canScrollDown: true } });
expect(buttons.at(1).props()).toEqual( expect(buttons.at(1).props()).toEqual(
jasmine.objectContaining({ direction: 'down', disabled: false }), expect.objectContaining({ direction: 'down', disabled: false }),
); );
}); });
......
...@@ -133,7 +133,7 @@ describe('EE IDE store terminal session controls actions', () => { ...@@ -133,7 +133,7 @@ describe('EE IDE store terminal session controls actions', () => {
[], [],
[ [
{ type: 'requestStartSession' }, { type: 'requestStartSession' },
{ type: 'receiveStartSessionError', payload: jasmine.any(Error) }, { type: 'receiveStartSessionError', payload: expect.any(Error) },
], ],
); );
}); });
...@@ -200,7 +200,7 @@ describe('EE IDE store terminal session controls actions', () => { ...@@ -200,7 +200,7 @@ describe('EE IDE store terminal session controls actions', () => {
[], [],
[ [
{ type: 'requestStopSession' }, { type: 'requestStopSession' },
{ type: 'receiveStopSessionError', payload: jasmine.any(Error) }, { type: 'receiveStopSessionError', payload: expect.any(Error) },
], ],
); );
}); });
...@@ -276,7 +276,7 @@ describe('EE IDE store terminal session controls actions', () => { ...@@ -276,7 +276,7 @@ describe('EE IDE store terminal session controls actions', () => {
[], [],
[ [
{ type: 'requestStartSession' }, { type: 'requestStartSession' },
{ type: 'receiveStartSessionError', payload: jasmine.any(Error) }, { type: 'receiveStartSessionError', payload: expect.any(Error) },
], ],
); );
}); });
......
...@@ -74,8 +74,8 @@ describe('Insights store actions', () => { ...@@ -74,8 +74,8 @@ describe('Insights store actions', () => {
actions.receiveConfigError, actions.receiveConfigError,
null, null,
null, null,
jasmine.any(Array), expect.any(Array),
jasmine.any(Array), expect.any(Array),
() => { () => {
expect(createFlash).toHaveBeenCalledWith( expect(createFlash).toHaveBeenCalledWith(
`There was an error fetching configuration for charts: Unknown Error`, `There was an error fetching configuration for charts: Unknown Error`,
......
...@@ -121,7 +121,7 @@ describe('extractGroupMilestones', () => { ...@@ -121,7 +121,7 @@ describe('extractGroupMilestones', () => {
expect(extractedMilestones.length).toBe(edges.length); expect(extractedMilestones.length).toBe(edges.length);
expect(extractedMilestones[0]).toEqual( expect(extractedMilestones[0]).toEqual(
jasmine.objectContaining({ expect.objectContaining({
...edges[0].node, ...edges[0].node,
}), }),
); );
......
...@@ -46,7 +46,7 @@ describe('EE MRWidget approvals footer', () => { ...@@ -46,7 +46,7 @@ describe('EE MRWidget approvals footer', () => {
expect(list.exists()).toBe(true); expect(list.exists()).toBe(true);
expect(list.props()).toEqual( expect(list.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
approvalRules: testApprovalRules(), approvalRules: testApprovalRules(),
}), }),
); );
...@@ -69,7 +69,7 @@ describe('EE MRWidget approvals footer', () => { ...@@ -69,7 +69,7 @@ describe('EE MRWidget approvals footer', () => {
expect(icon.exists()).toBe(true); expect(icon.exists()).toBe(true);
expect(icon.props()).toEqual( expect(icon.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
name: 'chevron-down', name: 'chevron-down',
}), }),
); );
...@@ -153,7 +153,7 @@ describe('EE MRWidget approvals footer', () => { ...@@ -153,7 +153,7 @@ describe('EE MRWidget approvals footer', () => {
expect(avatars.exists()).toBe(true); expect(avatars.exists()).toBe(true);
expect(avatars.props()).toEqual( expect(avatars.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
items: testSuggestedApprovers().filter((x, idx) => idx < 5), items: testSuggestedApprovers().filter((x, idx) => idx < 5),
breakpoint: 0, breakpoint: 0,
emptyText: '', emptyText: '',
......
...@@ -124,7 +124,7 @@ describe('EE MRWidget approvals list', () => { ...@@ -124,7 +124,7 @@ describe('EE MRWidget approvals list', () => {
expect(icon.exists()).toBe(true); expect(icon.exists()).toBe(true);
expect(icon.props()).toEqual( expect(icon.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
isApproved: true, isApproved: true,
}), }),
); );
...@@ -140,7 +140,7 @@ describe('EE MRWidget approvals list', () => { ...@@ -140,7 +140,7 @@ describe('EE MRWidget approvals list', () => {
expect(approvers.exists()).toBe(true); expect(approvers.exists()).toBe(true);
expect(approvers.props()).toEqual( expect(approvers.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
items: testApprovers(), items: testApprovers(),
}), }),
); );
...@@ -158,7 +158,7 @@ describe('EE MRWidget approvals list', () => { ...@@ -158,7 +158,7 @@ describe('EE MRWidget approvals list', () => {
expect(approvers.exists()).toBe(true); expect(approvers.exists()).toBe(true);
expect(approvers.props()).toEqual( expect(approvers.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
items: rule.approved_by, items: rule.approved_by,
}), }),
); );
...@@ -184,7 +184,7 @@ describe('EE MRWidget approvals list', () => { ...@@ -184,7 +184,7 @@ describe('EE MRWidget approvals list', () => {
expect(approvers.exists()).toBe(true); expect(approvers.exists()).toBe(true);
expect(approvers.props()).toEqual( expect(approvers.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
items: rule.approvers, items: rule.approvers,
}), }),
); );
...@@ -195,7 +195,7 @@ describe('EE MRWidget approvals list', () => { ...@@ -195,7 +195,7 @@ describe('EE MRWidget approvals list', () => {
expect(approvedBy.exists()).toBe(true); expect(approvedBy.exists()).toBe(true);
expect(approvedBy.props()).toEqual( expect(approvedBy.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
items: rule.approved_by, items: rule.approved_by,
}), }),
); );
...@@ -219,7 +219,7 @@ describe('EE MRWidget approvals list', () => { ...@@ -219,7 +219,7 @@ describe('EE MRWidget approvals list', () => {
expect(icon.exists()).toBe(true); expect(icon.exists()).toBe(true);
expect(icon.props()).toEqual( expect(icon.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
isApproved: false, isApproved: false,
}), }),
); );
...@@ -242,7 +242,7 @@ describe('EE MRWidget approvals list', () => { ...@@ -242,7 +242,7 @@ describe('EE MRWidget approvals list', () => {
expect(icon.exists()).toBe(true); expect(icon.exists()).toBe(true);
expect(icon.props()).toEqual( expect(icon.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
isApproved: false, isApproved: false,
}), }),
); );
......
...@@ -47,7 +47,7 @@ describe('EE MRWidget approvals summary', () => { ...@@ -47,7 +47,7 @@ describe('EE MRWidget approvals summary', () => {
expect(avatars.exists()).toBe(true); expect(avatars.exists()).toBe(true);
expect(avatars.props()).toEqual( expect(avatars.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
items: testApprovers(), items: testApprovers(),
}), }),
); );
......
...@@ -31,7 +31,7 @@ describe('EE MRWidget approved icon', () => { ...@@ -31,7 +31,7 @@ describe('EE MRWidget approved icon', () => {
expect(icon.exists()).toBe(true); expect(icon.exists()).toBe(true);
expect(icon.props()).toEqual( expect(icon.props()).toEqual(
jasmine.objectContaining({ expect.objectContaining({
size: EXPECTED_SIZE, size: EXPECTED_SIZE,
name: 'mobile-issue-close', name: 'mobile-issue-close',
}), }),
......
...@@ -28,7 +28,7 @@ describe('EE MR Widget mappers', () => { ...@@ -28,7 +28,7 @@ describe('EE MR Widget mappers', () => {
const result = mapApprovalsResponse(data); const result = mapApprovalsResponse(data);
expect(result).toEqual( expect(result).toEqual(
jasmine.objectContaining({ expect.objectContaining({
approvalRuleNamesLeft: ['Lorem', 'Ipsum'], approvalRuleNamesLeft: ['Lorem', 'Ipsum'],
}), }),
); );
...@@ -43,7 +43,7 @@ describe('EE MR Widget mappers', () => { ...@@ -43,7 +43,7 @@ describe('EE MR Widget mappers', () => {
const result = mapApprovalsResponse(data); const result = mapApprovalsResponse(data);
expect(result).toEqual( expect(result).toEqual(
jasmine.objectContaining({ expect.objectContaining({
approvalRuleNamesLeft: ['Lorem', 'Ipsum', 'License-Check', 'Vulnerability-Check'], approvalRuleNamesLeft: ['Lorem', 'Ipsum', 'License-Check', 'Vulnerability-Check'],
}), }),
); );
...@@ -58,7 +58,7 @@ describe('EE MR Widget mappers', () => { ...@@ -58,7 +58,7 @@ describe('EE MR Widget mappers', () => {
const result = mapApprovalsResponse(data); const result = mapApprovalsResponse(data);
expect(result).toEqual( expect(result).toEqual(
jasmine.objectContaining({ expect.objectContaining({
approvalRuleNamesLeft: ['Lorem', 'Ipsum', 'Code Owners'], approvalRuleNamesLeft: ['Lorem', 'Ipsum', 'Code Owners'],
}), }),
); );
...@@ -71,7 +71,7 @@ describe('EE MR Widget mappers', () => { ...@@ -71,7 +71,7 @@ describe('EE MR Widget mappers', () => {
}); });
expect(result).toEqual( expect(result).toEqual(
jasmine.objectContaining({ expect.objectContaining({
approvalRuleNamesLeft: [], approvalRuleNamesLeft: [],
}), }),
); );
...@@ -87,7 +87,7 @@ describe('EE MR Widget mappers', () => { ...@@ -87,7 +87,7 @@ describe('EE MR Widget mappers', () => {
const result = mapApprovalsResponse(data); const result = mapApprovalsResponse(data);
expect(result).toEqual( expect(result).toEqual(
jasmine.objectContaining({ expect.objectContaining({
approvalRuleNamesLeft: [], approvalRuleNamesLeft: [],
}), }),
); );
......
...@@ -391,7 +391,7 @@ describe('Security Reports modal', () => { ...@@ -391,7 +391,7 @@ describe('Security Reports modal', () => {
it('submits the comment and dismisses the vulnerability if text has been entered', () => { it('submits the comment and dismisses the vulnerability if text has been entered', () => {
const { vm } = wrapper; const { vm } = wrapper;
vm.addCommentAndDismiss = jasmine.createSpy(); vm.addCommentAndDismiss = jest.fn();
vm.localDismissalComment = comment; vm.localDismissalComment = comment;
vm.handleDismissalCommentSubmission(); vm.handleDismissalCommentSubmission();
...@@ -415,7 +415,7 @@ describe('Security Reports modal', () => { ...@@ -415,7 +415,7 @@ describe('Security Reports modal', () => {
it('submits the comment if text is entered and the vulnerability is already dismissed', () => { it('submits the comment if text is entered and the vulnerability is already dismissed', () => {
const { vm } = wrapper; const { vm } = wrapper;
vm.addDismissalComment = jasmine.createSpy(); vm.addDismissalComment = jest.fn();
vm.localDismissalComment = comment; vm.localDismissalComment = comment;
vm.handleDismissalCommentSubmission(); vm.handleDismissalCommentSubmission();
......
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