Skip to content

Commit ce4e5b2

Browse files
committed
fix: profile tests
1 parent 84e6bf2 commit ce4e5b2

File tree

5 files changed

+44
-11
lines changed

5 files changed

+44
-11
lines changed

src/client/shared/state/containers/profile/profile-model.hooks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable import/no-extraneous-dependencies */
22
// Libraries
3-
import React, { useContext } from 'react';
3+
import React from 'react';
44
import { of } from 'rxjs';
55
import { map, startWith } from 'rxjs/operators';
66

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Library
2+
import React from 'react';
3+
import { ApolloProvider } from 'react-apollo';
4+
import { createMockClient } from 'mock-apollo-client';
5+
import { ThemeProvider } from '@material-ui/styles';
6+
import { mount } from 'enzyme';
7+
8+
// Theme
9+
10+
// Internal
11+
// import ProfileComponent from '@omega-web-components/profile-box';
12+
import ProfileContainer from '../';
13+
14+
// Redux Model
15+
import theme from '../../../common/styles';
16+
17+
describe('container <ProfileContainer />', () => {
18+
let wrapper;
19+
// let component;
20+
let container;
21+
22+
beforeEach(() => {
23+
jest.resetAllMocks();
24+
25+
const mockClient = createMockClient();
26+
27+
wrapper = mount(
28+
<ApolloProvider client={mockClient}>
29+
<ThemeProvider theme={theme}>
30+
<ProfileContainer name={'John Doe'} />
31+
</ThemeProvider>
32+
</ApolloProvider>
33+
);
34+
container = wrapper.find(ProfileContainer);
35+
// component = container.find(ProfileComponent);
36+
});
37+
38+
it('should render both the container and the component ', () => {
39+
expect(container.length).toBeTruthy();
40+
// expect(component.length).toBeTruthy();
41+
});
42+
});

src/client/web/app/containers/profile/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Library
12
import React, { useEffect } from 'react';
23
import { initialProfileModel, ProfileContext } from './profile.model';
34
import useProfilePage from '../../../../shared/state/containers/profile/profile-model.hooks';

src/client/web/app/containers/profile/profile.components.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/client/web/app/containers/profile/profile.model.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Library
22
import React, { useState } from 'react';
3-
import { ProfileComponentsEngine } from './profile.components';
43

54
const ProfileContext = React.createContext([{}, () => { }]);
65
const initialProfileModel = {
@@ -11,9 +10,6 @@ const initialProfileModel = {
1110
libraries: {
1211
React,
1312
},
14-
components: {
15-
...ProfileComponentsEngine
16-
},
1713
actions: {
1814
},
1915
rules: {

0 commit comments

Comments
 (0)