@@ -8898,7 +8902,9 @@ string",
Service Providers
- We may employ third party companies and individuals to facilitate our Service ("Service Providers"), to provide the Service on our behalf, to perform Service-related services or to assist us in analyzing how our Service is used.
+ We may employ third party companies and individuals to facilitate our
+
+ Service ("Service Providers"), to provide the Service on our behalf, to perform Service-related services or to assist us in analyzing how our Service is used.
These third parties have access to your Personal Data only to perform these tasks on our behalf and are obligated not to disclose or use it for any other purpose.
@@ -8933,7 +8939,9 @@ string",
Links To Other Sites
- Our Service may contain links to other sites that are not operated by us. If you click on a third party link, you will be directed to that third party's site. We strongly advise you to review the Privacy Policy of every site you visit.
+ Our Service may contain links to other sites that are not operated by us. If you click on a third party link, you will be directed to that third party's site. We strongly advise
+
+ you to review the Privacy Policy of every site you visit.
We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.
diff --git a/src/auth/login/__tests__/LoginForm.test.js b/src/auth/login/__tests__/LoginForm.test.js
index bb02047..6854f94 100644
--- a/src/auth/login/__tests__/LoginForm.test.js
+++ b/src/auth/login/__tests__/LoginForm.test.js
@@ -52,7 +52,7 @@ describe('Login form test suite', () => {
errors: inputFields.reduce(
(prev, cur) => ({
...prev,
- [cur]: true,
+ [cur]: `Error ${cur}`,
}),
{},
),
@@ -89,7 +89,7 @@ describe('Login form test suite', () => {
errors: inputFields.reduce(
(prev, cur) => ({
...prev,
- [cur]: true,
+ [cur]: `Error: ${cur}`,
}),
{},
),
@@ -115,7 +115,7 @@ describe('Login form test suite', () => {
it('should show error message if error props is set', () => {
const props = {
...getFormProps(),
- error: true,
+ error: 'custom error',
};
const wrapper = mount( );
expect(wrapper).toBeTruthy();
diff --git a/src/auth/login/__tests__/LoginView.test.js b/src/auth/login/__tests__/LoginView.test.js
index c330a8f..80bedb2 100644
--- a/src/auth/login/__tests__/LoginView.test.js
+++ b/src/auth/login/__tests__/LoginView.test.js
@@ -20,7 +20,7 @@ describe('LoginView test suite', () => {
beforeEach(() => {
initialProps = {
isAuthenticated: false,
- histroy: {
+ history: {
push: jest.fn(),
},
loginRequest: {
diff --git a/src/auth/register/CheckEmailForm.jsx b/src/auth/register/CheckEmailForm.jsx
index 092656d..cd71168 100644
--- a/src/auth/register/CheckEmailForm.jsx
+++ b/src/auth/register/CheckEmailForm.jsx
@@ -97,7 +97,7 @@ const CheckEmailForm = (props) => {
CheckEmailForm.propTypes = {
error: PropTypes.node,
- validEmail: PropTypes.string,
+ validEmail: PropTypes.bool,
values: PropTypes.shape({}).isRequired,
touched: PropTypes.shape({}).isRequired,
errors: PropTypes.shape({}).isRequired,
diff --git a/src/auth/register/__tests__/CheckEmailForm.test.js b/src/auth/register/__tests__/CheckEmailForm.test.js
index 9afb8e5..392653d 100644
--- a/src/auth/register/__tests__/CheckEmailForm.test.js
+++ b/src/auth/register/__tests__/CheckEmailForm.test.js
@@ -24,9 +24,20 @@ describe('Register form test suite', () => {
return props;
};
+ const defaultProps = {
+ error: '',
+ };
+
+ const getCheckEmailForm = props => mount(
+ ,
+ );
+
it('should render', () => {
const props = getFormProps();
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(props);
expect(wrapper).toBeTruthy();
});
@@ -44,12 +55,12 @@ describe('Register form test suite', () => {
errors: inputFields.reduce(
(prev, cur) => ({
...prev,
- [cur]: true,
+ [cur]: `Error ${cur}`,
}),
{},
),
};
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(props);
// test fields
const fields = wrapper.find(Field);
@@ -78,12 +89,12 @@ describe('Register form test suite', () => {
errors: inputFields.reduce(
(prev, cur) => ({
...prev,
- [cur]: true,
+ [cur]: `Error: ${cur}`,
}),
{},
),
};
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(props);
// test fields
const fields = wrapper.find(Field);
@@ -104,7 +115,7 @@ describe('Register form test suite', () => {
...getFormProps(),
error,
};
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(props);
expect(wrapper).toBeTruthy();
// check for error message
@@ -119,7 +130,7 @@ describe('Register form test suite', () => {
...getFormProps(),
validEmail,
};
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(props);
expect(wrapper).toBeTruthy();
// check for error message
@@ -134,7 +145,7 @@ describe('Register form test suite', () => {
dirty: true,
submitting: true,
};
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(props);
const resetButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestResetButton');
expect(resetButton.props().disabled).toBeTruthy();
});
@@ -144,7 +155,7 @@ describe('Register form test suite', () => {
...getFormProps(),
submitting: true,
};
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(props);
const submitButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestSubmitButton');
expect(submitButton.props().disabled).toBeTruthy();
});
@@ -154,14 +165,14 @@ describe('Register form test suite', () => {
...getFormProps(),
submitting: true,
};
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(props);
const submitButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestSubmitButton');
expect(submitButton.props().loading).toBeTruthy();
});
// important to trigger Formik
it('submit button should be type of submit', () => {
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(getFormProps());
const submitButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestSubmitButton');
expect(submitButton.props().type).toEqual('submit');
});
@@ -174,7 +185,7 @@ describe('Register form test suite', () => {
dirty: true,
};
- const wrapper = mount( );
+ const wrapper = getCheckEmailForm(props);
const resetButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestResetButton');
expect(resetButton.exists()).toBeTruthy();
diff --git a/src/auth/register/__tests__/RegisterForm.test.js b/src/auth/register/__tests__/RegisterForm.test.js
index 8511486..b35e506 100644
--- a/src/auth/register/__tests__/RegisterForm.test.js
+++ b/src/auth/register/__tests__/RegisterForm.test.js
@@ -33,6 +33,20 @@ describe('Register form test suite', () => {
};
};
+ const initialProps = {
+ history: {
+ push: jest.fn(),
+ },
+ onCancel: jest.fn(),
+ };
+
+ const getRegisterForm = props => mount(
+ ,
+ );
+
const disabledFilter = (a) => {
const { disabled } = a.props();
@@ -41,7 +55,7 @@ describe('Register form test suite', () => {
it('should render', () => {
const props = getFormProps();
- const wrapper = mount( );
+ const wrapper = getRegisterForm(props);
expect(wrapper).toBeTruthy();
});
@@ -59,12 +73,12 @@ describe('Register form test suite', () => {
errors: inputFields.reduce(
(prev, cur) => ({
...prev,
- [cur]: true,
+ [cur]: `Error: ${cur}`,
}),
{},
),
};
- const wrapper = mount( );
+ const wrapper = getRegisterForm(props);
// test fields
const fields = wrapper.find(Field).filterWhere(disabledFilter);
@@ -101,7 +115,7 @@ describe('Register form test suite', () => {
{},
),
};
- const wrapper = mount( );
+ const wrapper = getRegisterForm(props);
// test fields
const fields = wrapper.find(Field).filterWhere(disabledFilter);
@@ -125,7 +139,7 @@ describe('Register form test suite', () => {
...getFormProps(),
error,
};
- const wrapper = mount( );
+ const wrapper = getRegisterForm(props);
expect(wrapper).toBeTruthy();
// check for error message
@@ -140,7 +154,7 @@ describe('Register form test suite', () => {
dirty: true,
submitting: true,
};
- const wrapper = mount( );
+ const wrapper = getRegisterForm(props);
const resetButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestResetButton');
expect(resetButton.props().disabled).toBeTruthy();
});
@@ -150,7 +164,7 @@ describe('Register form test suite', () => {
...getFormProps(),
submitting: true,
};
- const wrapper = mount( );
+ const wrapper = getRegisterForm(props);
const submitButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestSubmitButton');
expect(submitButton.props().disabled).toBeTruthy();
});
@@ -160,14 +174,14 @@ describe('Register form test suite', () => {
...getFormProps(),
submitting: true,
};
- const wrapper = mount( );
+ const wrapper = getRegisterForm(props);
const submitButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestSubmitButton');
expect(submitButton.props().loading).toBeTruthy();
});
// important to trigger Formik
it('submit button should be type of submit', () => {
- const wrapper = mount( );
+ const wrapper = getRegisterForm(getFormProps());
const submitButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestSubmitButton');
expect(submitButton.props().type).toEqual('submit');
});
@@ -179,7 +193,7 @@ describe('Register form test suite', () => {
onCancel: jest.fn(),
};
- const wrapper = mount( );
+ const wrapper = getRegisterForm(props);
const resetButton = wrapper.find(Button).filterWhere(n => n.props().testId === 'jestResetButton');
expect(resetButton.exists()).toBeTruthy();
diff --git a/src/auth/register/__tests__/RegisterView.test.js b/src/auth/register/__tests__/RegisterView.test.js
index 7e6f5a5..de0ce6d 100644
--- a/src/auth/register/__tests__/RegisterView.test.js
+++ b/src/auth/register/__tests__/RegisterView.test.js
@@ -21,7 +21,7 @@ describe('RegisterView test suite', () => {
beforeEach(() => {
initialProps = {
isAuthenticated: false,
- histroy: {
+ history: {
push: jest.fn(),
},
signupRequest: {
diff --git a/src/images/__tests__/__snapshots__/AddImageButton.test.js.snap b/src/images/__tests__/__snapshots__/AddImageButton.test.js.snap
index 721d27a..0069f0e 100644
--- a/src/images/__tests__/__snapshots__/AddImageButton.test.js.snap
+++ b/src/images/__tests__/__snapshots__/AddImageButton.test.js.snap
@@ -20188,7 +20188,7 @@ string",
className="c1"
>
- Hey it seems your image to big for being uploaded. We only allow uploading images up to
+ Hey it seems your image to big for being uploaded. We only allow uploading images up to
6 MB
@@ -65874,7 +65874,7 @@ string",
className="c1"
>
- Hey it seems your image to big for being uploaded. We only allow uploading images up to
+ Hey it seems your image to big for being uploaded. We only allow uploading images up to
6 MB
diff --git a/src/images/detail/__tests__/__snapshots__/Attribute.test.js.snap b/src/images/detail/__tests__/__snapshots__/Attribute.test.js.snap
index ec9ed01..8bf751a 100644
--- a/src/images/detail/__tests__/__snapshots__/Attribute.test.js.snap
+++ b/src/images/detail/__tests__/__snapshots__/Attribute.test.js.snap
@@ -1544,11 +1544,11 @@ exports[`Image Detail Attribute Attribute styles test suite StyledConfidence sho
display: inline-block;
margin-left: 0.25rem;
&:before {
- content: \\"(\\";
+ content: '(';
}
-
+
&:after {
- content: \\")\\";
+ content: ')';
}
",
],
diff --git a/src/images/detail/__tests__/__snapshots__/Faces.test.js.snap b/src/images/detail/__tests__/__snapshots__/Faces.test.js.snap
index d3c1c10..6363c2d 100644
--- a/src/images/detail/__tests__/__snapshots__/Faces.test.js.snap
+++ b/src/images/detail/__tests__/__snapshots__/Faces.test.js.snap
@@ -618,7 +618,8 @@ string",
- Face
+ Face
+
1
- Face
+ Face
+
1
- Face
+ Face
+
1
{
});
describe('ListItem test suite', () => {
- const getListItem = props => mount( );
+ const getListItem = props => mount(
+ ,
+ );
it('should render', () => {
const wrapper = getListItem();
diff --git a/src/redux/images/__tests__/index.test.js b/src/redux/images/__tests__/index.test.js
index 1f0cfde..5a2a101 100644
--- a/src/redux/images/__tests__/index.test.js
+++ b/src/redux/images/__tests__/index.test.js
@@ -207,7 +207,7 @@ describe('images complex action test suite', () => {
const HOC_ACTIONS = testUtils.createHocActions({
baseType: 'IMAGES_ADD_REQUEST',
payload: { addImage },
- error: 'Not a valid file type',
+ error: new Error('Not a valid file type'),
errorIsHandled: true,
});
diff --git a/src/redux/user/index.js b/src/redux/user/index.js
index 554883d..15cff56 100644
--- a/src/redux/user/index.js
+++ b/src/redux/user/index.js
@@ -38,7 +38,7 @@ export const updateUser = hocAsyncAction(USER_UPDATE_USER_REQUEST, user => (disp
};
return GraphApi.mutation(UPDATE_USER, variables).then((data) => {
- dispatch(userSetUser(data.user));
+ dispatch(userSetUser(data.updateUser.user));
return data;
});
diff --git a/src/setupTests.js b/src/setupTests.js
index 59f9ef0..4a022a6 100644
--- a/src/setupTests.js
+++ b/src/setupTests.js
@@ -92,7 +92,7 @@ const createFormitState = (formElements = {}) => ({
),
dirty: false,
submitting: false,
- error: false,
+ error: '',
handleChange: jest.fn(),
handleBlur: jest.fn(),
handleSubmit: jest.fn(),
diff --git a/src/ui/__tests__/__snapshots__/Footer.test.js.snap b/src/ui/__tests__/__snapshots__/Footer.test.js.snap
index ad4b35c..16bdc58 100644
--- a/src/ui/__tests__/__snapshots__/Footer.test.js.snap
+++ b/src/ui/__tests__/__snapshots__/Footer.test.js.snap
@@ -6906,7 +6906,7 @@ string",
className="c0 c1"
>
- Created by:
+ Created by:
- Created by:
+ Created by:
- Created by:
+ Created by:
shallow( );
-const getMountField = (props = {}) => mount( );
+const initialProps = {
+ children: child
,
+};
+
+const getShallowField = (props = {}) => shallow( );
+const getMountField = (props = {}) => mount( );
// Field component tests
it('Field should render correctly', () => {
- const wrapper = shallow( );
+ const wrapper = getShallowField();
expect(toJson(wrapper.dive())).toMatchSnapshot();
});
@@ -36,7 +40,7 @@ it('Field should render content', () => {
});
it('Field should not render label if no label is passed in', () => {
- const output = getShallowField();
+ const output = getShallowField({ label: undefined });
expect(output.find(StyledFieldLabel).length).toEqual(0);
});
@@ -53,7 +57,7 @@ it('Field should render label with custom props', () => {
// check for label component
const label = output.find(StyledFieldLabel);
- expect(label).toBeTruthy();
+ expect(label.exists()).toBeTruthy();
// check for label props
const labelProps = label.props();
@@ -82,7 +86,8 @@ it('Field should render Feedback with error', () => {
// Input tests
it('TextInput should work correctly', () => {
- expect(shallow( ));
+ const wrapper = shallow( );
+ expect(wrapper.exists()).toBeTruthy();
});
it('Input styles should be consistent', () => {
@@ -102,7 +107,8 @@ it('Error Input should render correctly', () => {
// Checkbox tests
it('CheckBox should work correctly', () => {
- expect(shallow( ));
+ const wrapper = shallow( );
+ expect(wrapper.exists()).toBeTruthy();
});
it('Checkbox styles should be consistent', () => {
@@ -117,7 +123,8 @@ it('Checkbox Input should render correctly', () => {
// Test StyledFieldRow
it('FieldRow should work correctly', () => {
- expect(shallow( ));
+ const wrapper = shallow(fieldrow
);
+ expect(wrapper.exists()).toBeTruthy();
});
it('FieldRow styles should be consistent', () => {
diff --git a/src/ui/form/__tests__/__snapshots__/ButtonGroup.test.js.snap b/src/ui/form/__tests__/__snapshots__/ButtonGroup.test.js.snap
index c82fbb8..aa84ff5 100644
--- a/src/ui/form/__tests__/__snapshots__/ButtonGroup.test.js.snap
+++ b/src/ui/form/__tests__/__snapshots__/ButtonGroup.test.js.snap
@@ -29,7 +29,9 @@ exports[`ButtonGroup should render correctly 1`] = `
}
forwardedRef={null}
>
-
+
Click me
diff --git a/src/ui/form/__tests__/__snapshots__/Form.test.js.snap b/src/ui/form/__tests__/__snapshots__/Form.test.js.snap
index 1707084..2e95f1c 100644
--- a/src/ui/form/__tests__/__snapshots__/Form.test.js.snap
+++ b/src/ui/form/__tests__/__snapshots__/Form.test.js.snap
@@ -4040,7 +4040,7 @@ exports[`Extended Field should render correctly 1`] = `
"isStatic": false,
"rules": Array [
"
- margin: .75rem 0;
+ margin: 0.75rem 0;
",
[Function],
@@ -4082,7 +4082,7 @@ exports[`Field should render correctly 1`] = `
"isStatic": false,
"rules": Array [
"
- margin: .75rem 0;
+ margin: 0.75rem 0;
",
[Function],
@@ -4102,7 +4102,11 @@ exports[`Field should render correctly 1`] = `
}
forwardedRef={null}
inline={false}
-/>
+>
+
+ child
+
+
`;
exports[`FieldRow styles should be consistent 1`] = `
diff --git a/src/user/UpdateUserForm.jsx b/src/user/UpdateUserForm.jsx
index 393f9e0..2212d54 100644
--- a/src/user/UpdateUserForm.jsx
+++ b/src/user/UpdateUserForm.jsx
@@ -130,11 +130,11 @@ UpdateUserForm.propTypes = {
handleSubmit: PropTypes.func.isRequired,
handleReset: PropTypes.func.isRequired,
submitting: PropTypes.bool.isRequired,
- error: PropTypes.bool,
+ error: PropTypes.string,
};
UpdateUserForm.defaultProps = {
- error: false,
+ error: null,
};
const EnhancedUpdateUserForm = formikEnhancer(UpdateUserForm);
diff --git a/src/user/__tests__/UpdateUserForm.test.js b/src/user/__tests__/UpdateUserForm.test.js
index 9a8d57e..0901845 100644
--- a/src/user/__tests__/UpdateUserForm.test.js
+++ b/src/user/__tests__/UpdateUserForm.test.js
@@ -43,7 +43,7 @@ describe('Register form test suite', () => {
errors: inputFields.reduce(
(prev, cur) => ({
...prev,
- [cur]: true,
+ [cur]: `Error: ${cur}`,
}),
{},
),