Skip to content

Commit

Permalink
Merge pull request #103 from iCHEF/CJ/upgrade_jest
Browse files Browse the repository at this point in the history
Upgrade jest to v21
  • Loading branch information
cjies authored Oct 26, 2017
2 parents d7ec983 + 5aa9045 commit faf1824
Show file tree
Hide file tree
Showing 7 changed files with 355 additions and 319 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Upgrade storybook libraries to v3.2.12, also fix the API changes of `storybook-addon-info`. (#93)(#95)
- Deprecate `escapable()` mixin in favor of new `closable()`.
- The `padding` option for `anchored()` is renamed to `edgePadding` for better understanding.
- Upgrade webpack of main package to v3. (#101)
- Upgrade jest to v21.2. (#103)

### Bugs Fix
- [InfiniteScroll] Attach scroll listener when the `scrollNode` is existing.
- [storybook] Fix <InfiniteScroll> stories.

### Breaking
- `<Tooltip>` now default-exports an anchored version. `<AnchoredTooltip>` is removed from bundle.
Expand Down
2 changes: 1 addition & 1 deletion configs/jest.config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"rootDir": "../",
"coverageReporters": ["cobertura", "lcov", "text"],
"moduleNameMapper": {
"\\.(css|scss|sass|md|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|)$": "<rootDir>/__mocks__/fileMock.js"
},
"testRegex": "(/__tests__/.*.(test|spec))\\.jsx?$",
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!@ichef/)"
]
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
"babel-cli": "^6.23.0",
"babel-core": "^6.23.1",
"babel-eslint": "^7.1.1",
"babel-jest": "^19.0.0",
"babel-jest": "^21.2.0",
"babel-loader": "^6.3.2",
"babel-plugin-module-resolver": "^3.0.0-beta.5",
"babel-plugin-strip-css-imports": "zhusee2/babel-plugin-strip-css-imports",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.2.1",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-2": "^6.22.0",
"coveralls": "^2.13.1",
"coveralls": "^3.0.0",
"css-loader": "^0.28.7",
"eslint": "^3.17.1",
"eslint-config-airbnb": "^14.1.0",
Expand All @@ -59,7 +59,7 @@
"extract-text-webpack-plugin": "^3.0.1",
"file-loader": "^1.1.5",
"flow-bin": "^0.47.0",
"jest": "^19.0.2",
"jest": "^21.2.1",
"lerna": "^2.4.0",
"node-sass": "^4.5.3",
"postcss-loader": "^2.0.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"babel-cli": "^6.23.0",
"enzyme": "^2.8.2",
"sinon": "^2.2.0",
"sinon": "^4.0.1",
"webpack": "^3.8.1"
}
}
8 changes: 5 additions & 3 deletions packages/core/src/InfiniteScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,12 @@ class InfiniteScroll extends PureComponent {
const { usePageAsContainer } = this.props;
this.scrollContainer = usePageAsContainer
? window
: this.scrollNode.parentNode;
: this.scrollNode && this.scrollNode.parentNode;

this.scrollContainer
.addEventListener('scroll', this.handleScrollListener);
if (this.scrollContainer) {
this.scrollContainer
.addEventListener('scroll', this.handleScrollListener);
}
}

detachScrollListener = () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/storybook/examples/InfiniteScroll/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import PageAsContainerExample from './PageAsContainer';
storiesOf('InfiniteScroll', module)
.add('basic usage',
withInfo('placed in a fixed height container')(
<BasicUsageExample />
() => <BasicUsageExample />
)
)
.add('page as scroll container',
withInfo()(
withInfo({ inline: false })(
() => <PageAsContainerExample />
)({ source: false })
)
)
// Props table
.addPropsTable(
Expand Down
Loading

0 comments on commit faf1824

Please sign in to comment.