From cc36b46925bcea779b32f80b07f922237a89c1dd Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 21 Jun 2019 12:15:59 -0400 Subject: [PATCH] remove network context mock --- .../OrganizationEdit.test.jsx | 37 ++----------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/src/screens/Organization/OrganizationEdit/OrganizationEdit.test.jsx b/src/screens/Organization/OrganizationEdit/OrganizationEdit.test.jsx index 2277cd601b..c635652c99 100644 --- a/src/screens/Organization/OrganizationEdit/OrganizationEdit.test.jsx +++ b/src/screens/Organization/OrganizationEdit/OrganizationEdit.test.jsx @@ -10,8 +10,6 @@ jest.mock('@api'); const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); describe('', () => { - let api; - const mockData = { name: 'Foo', description: 'Bar', @@ -22,23 +20,8 @@ describe('', () => { } }; - beforeEach(() => { - api = { - getInstanceGroups: jest.fn(), - updateOrganizationDetails: jest.fn(), - associateInstanceGroup: jest.fn(), - disassociate: jest.fn(), - }; - }); - test('handleSubmit should call api update', () => { - const wrapper = mountWithContexts( - , { context: { network: { - api, - } } } - ); + const wrapper = mountWithContexts(); const updatedOrgData = { name: 'new name', @@ -51,13 +34,7 @@ describe('', () => { }); test('handleSubmit associates and disassociates instance groups', async () => { - const wrapper = mountWithContexts( - , { context: { network: { - api, - } } } - ); + const wrapper = mountWithContexts(); const updatedOrgData = { name: 'new name', @@ -77,14 +54,8 @@ describe('', () => { push: jest.fn(), }; const wrapper = mountWithContexts( - , { context: { - network: { - api: { api }, - }, - router: { history } - } } + , + { context: { router: { history } } } ); expect(history.push).not.toHaveBeenCalled();