From 95118daa1845dfc5370c34790e02a03b5c5b5483 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 2 Jan 2019 15:50:30 +0100 Subject: [PATCH] enable withUserOrganizations test --- .../hoc/__tests__/withUserOrganizations-test.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/server/sonar-web/src/main/js/components/hoc/__tests__/withUserOrganizations-test.tsx b/server/sonar-web/src/main/js/components/hoc/__tests__/withUserOrganizations-test.tsx index 8b925aa77c7..72850e444d9 100644 --- a/server/sonar-web/src/main/js/components/hoc/__tests__/withUserOrganizations-test.tsx +++ b/server/sonar-web/src/main/js/components/hoc/__tests__/withUserOrganizations-test.tsx @@ -35,17 +35,13 @@ class X extends React.Component<{ const UnderTest = withUserOrganizations(X); -// TODO Find a way to make this work, currently getting the following error : Actions must be plain objects. Use custom middleware for async actions. -it.skip('should pass user organizations and logged in user', () => { +it('should pass user organizations and logged in user', () => { const org = { key: 'my-org', name: 'My Organization' }; const store = createStore(state => state, { organizations: { byKey: { 'my-org': org }, my: ['my-org'] } }); - const wrapper = shallow(, { context: { store } }); - const wrappedComponent = wrapper - .dive() - .dive() - .dive(); + const wrapper = shallow(, { context: { store }, disableLifecycleMethods: true }); + const wrappedComponent = wrapper.dive(); expect(wrappedComponent.type()).toBe(X); expect(wrappedComponent.prop('userOrganizations')).toEqual([org]); }); -- 2.39.5