瀏覽代碼

enable withUserOrganizations test

tags/7.6
Stas Vilchik 5 年之前
父節點
當前提交
95118daa18
共有 1 個檔案被更改,包括 3 行新增7 行删除
  1. 3
    7
      server/sonar-web/src/main/js/components/hoc/__tests__/withUserOrganizations-test.tsx

+ 3
- 7
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(<UnderTest />, { context: { store } });
const wrappedComponent = wrapper
.dive()
.dive()
.dive();
const wrapper = shallow(<UnderTest />, { context: { store }, disableLifecycleMethods: true });
const wrappedComponent = wrapper.dive();
expect(wrappedComponent.type()).toBe(X);
expect(wrappedComponent.prop('userOrganizations')).toEqual([org]);
});

Loading…
取消
儲存