Skip to content

Commit

Permalink
Test RelationForm
Browse files Browse the repository at this point in the history
  • Loading branch information
soupette committed Mar 27, 2019
1 parent a3419da commit b98905a
Show file tree
Hide file tree
Showing 10 changed files with 845 additions and 49 deletions.
27 changes: 0 additions & 27 deletions jest.config.front.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,16 @@ const jest = require('jest');

module.exports = {
collectCoverageFrom: [
// 'packages/strapi-admin/admin/src/**/**/*.{js,jsx}',
'packages/strapi-plugin-content-type-builder/admin/src/**/**/*.js',
'packages/strapi-plugin-content-type-builder/admin/src/InjectedComponents/*.js',
'packages/strapi-plugin-content-type-builder/admin/src/InjectedComponents/tests/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/containers/AppOld/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/containers/HomePageOld/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/containers/ModelPageOld/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/containers/Form/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/ContentHeader/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/AttributeCard/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/AttributeRow/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/InputCheckboxWithNestedInputs/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/List/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/PluginLeftMenu/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/PluginLeftMenuLink/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/PluginLeftMenuSection/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/PopUpForm/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/PopUpHeaderNavLink/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/PopUpRelations/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/RelationBox/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/RelationIco/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/RelationNaturePicker/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/TableList/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/components/TableListRow/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/containers/Form/utils/*.js',
'!packages/strapi-plugin-content-type-builder/admin/src/utils/*.js',
// 'packages/strapi-plugin-**/**/admin/src/**/**/*.{js,jsx}',
'!packages/strapi-admin/admin/src/*.{js,jsx}',
'!packages/strapi-plugin-**/**/admin/src/*.{js,jsx}',
'!packages/strapi-admin/admin/src/**/**/tests/*.test.{js,jsx}',
'!packages/strapi-plugin-*/admin/src/**/**/tests/*.test.{js,jsx}',
],
coverageThreshold: {
global: {
// NOTE: This should be increased at some point
statements: 90,
branches: 90,
functions: 90,
Expand All @@ -47,10 +22,8 @@ module.exports = {
__webpack_public_path__: 'http://localhost:4000',
strapi: {},
},
// NOTE: Should be dynamic
moduleDirectories: [
'node_modules',
// '<rootDir>/packages/strapi-admin/admin/src',
'<rootDir>/packages/strapi-helper-plugin/node_modules',
'<rootDir>/packages/strapi-helper-plugin',
'<rootDir>/packages/strapi-helper-plugin/lib/src',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class App extends React.Component {
this.props.getData();
}

/* istanbul ignore next */
componentDidUpdate(prevProps) {
if (prevProps.shouldRefetchData !== this.props.shouldRefetchData) {
this.props.getData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,6 @@ function appReducer(state = initialState, action) {
}

return state
.updateIn(['temporaryAttributeRelation', 'target'], () => action.target)
.updateIn(['temporaryAttributeRelation', 'name'], () => action.target)
.updateIn(['temporaryAttributeRelation', 'plugin'], () => action.source || '')
.updateIn(['temporaryAttributeRelation', 'target'], () => action.target)
.updateIn(['temporaryAttributeRelation', 'name'], () => action.target)
.updateIn(['temporaryAttributeRelation', 'plugin'], () => action.source || '');
Expand Down
Loading

0 comments on commit b98905a

Please sign in to comment.