Skip to content

Commit 7e12893

Browse files
authored
Merge pull request #34 from georgeOsdDev/develop
Fix #31, Update dependencies
2 parents d62ad98 + 559e2c7 commit 7e12893

File tree

8 files changed

+4746
-49
lines changed

8 files changed

+4746
-49
lines changed

.babelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"presets": [
3-
"es2015",
3+
"env",
44
"react"
55
]
6-
}
6+
}

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- "0.10"
3+
- "node"
44
before_install:
55
- "export DISPLAY=:99.0"
6-
- "sh -e /etc/init.d/xvfb start"
6+
- "sh -e /etc/init.d/xvfb start"

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
### Ver 0.3.0 (Next Release)
44

5+
* [Update React and dependencies](https://github.com/georgeOsdDev/react-web-notification/issues/31)
6+
57
### Ver 0.2.4
68

79
* [#28 Use prop-types package instead of accessing PropTypes](https://github.com/georgeOsdDev/react-web-notification/issues/28), thanks @AlexNisnevich

karma.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ module.exports = function(config) {
4040
{
4141
'compact': false,
4242
'presets': [
43-
'react',
44-
'es2015'
43+
'env',
44+
'react'
4545
]
4646
}
4747
]

package.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-web-notification",
3-
"version": "0.2.4",
3+
"version": "0.3.0",
44
"description": "React component with HTML5 Web Notification API",
55
"main": "./lib/components/Notification.js",
66
"scripts": {
@@ -31,37 +31,37 @@
3131
"devDependencies": {
3232
"babel-cli": "^6.3.17",
3333
"babel-core": "^6.3.21",
34-
"babel-eslint": "^5.0.0-beta6",
35-
"babel-preset-es2015": "^6.3.13",
34+
"babel-eslint": "^8.0.2",
3635
"babel-preset-react": "^6.3.13",
37-
"babelify": "^7.2.0",
36+
"babelify": "^8.0.0",
3837
"browser-sync": "^2.10.1",
39-
"browserify": "^12.0.1",
40-
"chai": "^3.4.1",
41-
"eslint": "^1.10.3",
42-
"eslint-plugin-react": "^3.12.0",
43-
"karma": "^0.13.15",
44-
"karma-browserify": "^4.4.2",
38+
"browserify": "^14.5.0",
39+
"chai": "^4.1.2",
40+
"eslint": "^4.12.1",
41+
"eslint-plugin-react": "^7.5.1",
42+
"karma": "^1.7.1",
43+
"karma-browserify": "^5.1.2",
4544
"karma-chai": "^0.1.0",
46-
"karma-chrome-launcher": "^0.2.2",
47-
"karma-cli": "0.1.1",
48-
"karma-firefox-launcher": "^0.1.7",
49-
"karma-mocha": "^0.2.1",
50-
"karma-safari-launcher": "^0.1.1",
51-
"karma-spec-reporter": "0.0.23",
52-
"mocha": "^2.3.4",
45+
"karma-chrome-launcher": "^2.2.0",
46+
"karma-cli": "1.0.1",
47+
"karma-firefox-launcher": "^1.0.1",
48+
"karma-mocha": "^1.3.0",
49+
"karma-safari-launcher": "^1.0.0",
50+
"karma-spec-reporter": "0.0.31",
51+
"mocha": "^4.0.1",
5352
"prop-types": "^15.5.8",
5453
"react-addons-test-utils": "^0.14.3 || ^15.0.1",
55-
"react-dom": "^0.14.3 || ^15.0.1",
54+
"react-dom": "^16.2.0",
5655
"rimraf": "^2.4.4",
57-
"sinon": "^1.17.2",
56+
"sinon": "^4.1.2",
5857
"watchify": "^3.6.1"
5958
},
6059
"dependencies": {
61-
"react": "^0.14.3 || ^15.0.1"
60+
"babel-preset-env": "^1.6.1",
61+
"react": "^16.2.0"
6262
},
6363
"peerDependencies": {
64-
"react": "^0.14.3 || ^15.0.1"
64+
"react": "^16.2.0"
6565
},
6666
"browserify": {
6767
"transform": [
@@ -70,7 +70,7 @@
7070
{
7171
"compact": false,
7272
"presets": [
73-
"es2015",
73+
"env",
7474
"react"
7575
]
7676
}

src/components/Notification.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
import React from 'react';
42
import { bool, func, number, object, string } from 'prop-types';
53

test/components/Notification_spec.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
'use strict';
2-
31
import React from 'react';
42
import ReactDom from 'react-dom';
5-
import TestUtils from 'react-addons-test-utils';
3+
import ReactTestUtils from 'react-dom/test-utils';
64

75
import chai from 'chai';
86
import sinon from 'sinon';
@@ -24,7 +22,7 @@ describe('Test of Notification', () => {
2422

2523
describe('Notification component', () => {
2624
it('should have default properties', function () {
27-
component = TestUtils.renderIntoDocument(<Notification title='test'/>);
25+
component = ReactTestUtils.renderIntoDocument(<Notification title='test'/>);
2826
expect(component.props.ignore).to.be.eql(false);
2927
expect(component.props.disableActiveWindow).to.be.eql(false);
3028
expect(component.props.askAgain).to.be.eql(false);
@@ -40,8 +38,8 @@ describe('Test of Notification', () => {
4038
});
4139

4240
it('should render dummy hidden tag', function () {
43-
component = TestUtils.renderIntoDocument(<Notification title='test'/>);
44-
const el = TestUtils.scryRenderedDOMComponentsWithTag(component, 'input');
41+
component = ReactTestUtils.renderIntoDocument(<Notification title='test'/>);
42+
const el = ReactTestUtils.scryRenderedDOMComponentsWithTag(component, 'input');
4543
expect(el.length).to.be.eql(1);
4644
expect(ReactDom.findDOMNode(el[0]).type).to.be.eql('hidden');
4745
});
@@ -64,7 +62,7 @@ describe('Test of Notification', () => {
6462

6563
it('should call notSupported prop', () => {
6664
let spy = sinon.spy();
67-
component = TestUtils.renderIntoDocument(<Notification title='test' notSupported={spy}/>);
65+
component = ReactTestUtils.renderIntoDocument(<Notification title='test' notSupported={spy}/>);
6866
expect(spy.calledOnce).to.be.eql(true);
6967
expect(stub.called).to.be.eql(false);
7068
});
@@ -79,10 +77,10 @@ describe('Test of Notification', () => {
7977
before(() => {
8078
spy1 = sinon.spy();
8179
spy2 = sinon.spy();
82-
stub = sinon.stub(window.Notification, 'requestPermission', function(cb){
80+
stub = sinon.stub(window.Notification, 'requestPermission').callsFake(function(cb){
8381
return cb(PERMISSION_DENIED);
8482
});
85-
component = TestUtils.renderIntoDocument(<Notification title='test' notSupported={spy1} onPermissionDenied={spy2}/>);
83+
component = ReactTestUtils.renderIntoDocument(<Notification title='test' notSupported={spy1} onPermissionDenied={spy2}/>);
8684
});
8785

8886
after(() => {
@@ -107,11 +105,13 @@ describe('Test of Notification', () => {
107105
before(() => {
108106
spy1 = sinon.spy();
109107
spy2 = sinon.spy();
110-
stub1 = sinon.stub(window.Notification, 'permission', { get: function () { return PERMISSION_DENIED; } });
111-
stub2 = sinon.stub(window.Notification, 'requestPermission', function(cb){
108+
stub1 = sinon.stub(window.Notification, 'permission').get(function getterFn() {
109+
return PERMISSION_DENIED;
110+
});
111+
stub2 = sinon.stub(window.Notification, 'requestPermission').callsFake(function(cb){
112112
return cb(PERMISSION_DENIED);
113113
});
114-
component = TestUtils.renderIntoDocument(<Notification title='test' notSupported={spy1} onPermissionDenied={spy2}/>);
114+
component = ReactTestUtils.renderIntoDocument(<Notification title='test' notSupported={spy1} onPermissionDenied={spy2}/>);
115115
});
116116

117117
after(() => {
@@ -138,11 +138,13 @@ describe('Test of Notification', () => {
138138
spy1 = sinon.spy();
139139
spy2 = sinon.spy();
140140
spy3 = sinon.spy();
141-
stub1 = sinon.stub(window.Notification, 'permission', { get: function () { return PERMISSION_DENIED; } });
142-
stub2 = sinon.stub(window.Notification, 'requestPermission', function(cb){
141+
stub1 = sinon.stub(window.Notification, 'permission').get(function getterFn() {
142+
return PERMISSION_DENIED;
143+
});
144+
stub2 = sinon.stub(window.Notification, 'requestPermission').callsFake(function(cb){
143145
return cb(PERMISSION_GRANTED);
144146
});
145-
component = TestUtils.renderIntoDocument(<Notification title='test' notSupported={spy1} onPermissionDenied={spy2} onPermissionGranted={spy3} askAgain={true}/>);
147+
component = ReactTestUtils.renderIntoDocument(<Notification title='test' notSupported={spy1} onPermissionDenied={spy2} onPermissionGranted={spy3} askAgain={true}/>);
146148
});
147149

148150
after(() => {
@@ -165,7 +167,7 @@ describe('Test of Notification', () => {
165167
describe('When Notification is granted', () => {
166168
let stub;
167169
before(() => {
168-
stub = sinon.stub(window.Notification, 'requestPermission', function(cb){
170+
stub = sinon.stub(window.Notification, 'requestPermission').callsFake(function(cb){
169171
return cb(PERMISSION_GRANTED);
170172
});
171173
});
@@ -180,7 +182,7 @@ describe('Test of Notification', () => {
180182
spy1 = sinon.spy();
181183
spy2 = sinon.spy();
182184
spy3 = sinon.spy();
183-
component = TestUtils.renderIntoDocument(<Notification title='test' notSupported={spy1} onPermissionDenied={spy2} onPermissionGranted={spy3}/>);
185+
component = ReactTestUtils.renderIntoDocument(<Notification title='test' notSupported={spy1} onPermissionDenied={spy2} onPermissionGranted={spy3}/>);
184186
});
185187

186188
it('should call window.Notification.requestPermission', () => {
@@ -218,7 +220,7 @@ describe('Test of Notification', () => {
218220
onErrorSpy = sinon.spy();
219221

220222
it('does not trigger Notification', () => {
221-
component = TestUtils.renderIntoDocument(<Notification title='test' ignore={true} onShow={onShowSpy} onClick={onClickSpy} onClose={onCloseSpy} onError={onErrorSpy} />);
223+
component = ReactTestUtils.renderIntoDocument(<Notification title='test' ignore={true} onShow={onShowSpy} onClick={onClickSpy} onClose={onCloseSpy} onError={onErrorSpy} />);
222224
expect(stubConstructor.calledWithNew()).to.be.eql(false);
223225
expect(onShowSpy.called).to.be.eql(false);
224226
expect(onClickSpy.called).to.be.eql(false);
@@ -242,7 +244,7 @@ describe('Test of Notification', () => {
242244
onErrorSpy = sinon.spy();
243245

244246
it('trigger Notification with specified title and options', () => {
245-
component = TestUtils.renderIntoDocument(<Notification title={MY_TITLE} options={MY_OPTIONS} ignore={false} onShow={onShowSpy} onClick={onClickSpy} onClose={onCloseSpy} onError={onErrorSpy} />);
247+
component = ReactTestUtils.renderIntoDocument(<Notification title={MY_TITLE} options={MY_OPTIONS} ignore={false} onShow={onShowSpy} onClick={onClickSpy} onClose={onCloseSpy} onError={onErrorSpy} />);
246248
expect(stubConstructor.calledWithNew()).to.be.eql(true);
247249
expect(stubConstructor.calledWith(MY_TITLE, MY_OPTIONS)).to.be.eql(true);
248250
});

0 commit comments

Comments
 (0)