From cefe6cded6728ff95d951435430da311356c3b23 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Sat, 25 Nov 2017 18:37:12 -0600 Subject: [PATCH 1/5] Update to Enzyme 3.2.0 --- package.json | 3 ++- test/helper.js | 4 ++++ test/lib/shallow-with-store.js | 15 ++++++++++----- test/unit/components/balance-component-test.js | 2 +- test/unit/components/pending-tx-test.js | 2 +- test/unit/responsive/components/dropdown-test.js | 6 +++--- 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 12c839739..27fea1495 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,8 @@ "deep-freeze-strict": "^1.1.1", "del": "^3.0.0", "envify": "^4.0.0", - "enzyme": "^2.8.2", + "enzyme": "^3.2.0", + "enzyme-adapter-react-15": "^1.0.5", "eslint-plugin-chai": "0.0.1", "eslint-plugin-mocha": "^4.9.0", "eslint-plugin-react": "^7.4.0", diff --git a/test/helper.js b/test/helper.js index 1c5934a89..a3abbebf2 100644 --- a/test/helper.js +++ b/test/helper.js @@ -1,3 +1,7 @@ +import Enzyme from 'enzyme' +import Adapter from 'enzyme-adapter-react-15' + +Enzyme.configure({ adapter: new Adapter() }) // disallow promises from swallowing errors enableFailureOnUnhandledPromiseRejection() diff --git a/test/lib/shallow-with-store.js b/test/lib/shallow-with-store.js index 411aa0455..2a66adb17 100644 --- a/test/lib/shallow-with-store.js +++ b/test/lib/shallow-with-store.js @@ -1,11 +1,16 @@ -const shallow = require('enzyme').shallow +const { shallow, mount } = require('enzyme') -module.exports = shallowWithStore - -function shallowWithStore (component, store) { +exports.shallowWithStore = function shallowWithStore (component, store) { const context = { store, } return shallow(component, { context }) -}; +} + +exports.mountWithStore = function mountWithStore (component, store) { + const context = { + store, + } + return mount(component, { context }) +} diff --git a/test/unit/components/balance-component-test.js b/test/unit/components/balance-component-test.js index a5fededc8..9b1e82acf 100644 --- a/test/unit/components/balance-component-test.js +++ b/test/unit/components/balance-component-test.js @@ -1,7 +1,7 @@ const assert = require('assert') const h = require('react-hyperscript') const { createMockStore } = require('redux-test-utils') -const shallowWithStore = require('../../lib/shallow-with-store') +const { shallowWithStore } = require('../../lib/shallow-with-store') const BalanceComponent = require('../../../ui/app/components/balance-component') const mockState = { metamask: { diff --git a/test/unit/components/pending-tx-test.js b/test/unit/components/pending-tx-test.js index 97cac3216..c6c588e1c 100644 --- a/test/unit/components/pending-tx-test.js +++ b/test/unit/components/pending-tx-test.js @@ -4,7 +4,7 @@ const PendingTx = require('../../../ui/app/components/pending-tx') const ethUtil = require('ethereumjs-util') const { createMockStore } = require('redux-test-utils') -const shallowWithStore = require('../../lib/shallow-with-store') +const { shallowWithStore } = require('../../lib/shallow-with-store') const identities = { abc: {}, def: {} } const mockState = { diff --git a/test/unit/responsive/components/dropdown-test.js b/test/unit/responsive/components/dropdown-test.js index 932b6c752..982d8c6ec 100644 --- a/test/unit/responsive/components/dropdown-test.js +++ b/test/unit/responsive/components/dropdown-test.js @@ -6,7 +6,7 @@ const path = require('path'); const Dropdown = require(path.join(__dirname, '..', '..', '..', '..', 'ui', 'app', 'components', 'dropdowns', 'index.js')).Dropdown; const { createMockStore } = require('redux-test-utils') -const shallowWithStore = require('../../../lib/shallow-with-store') +const { mountWithStore } = require('../../../lib/shallow-with-store') const mockState = { metamask: { @@ -39,7 +39,7 @@ describe('Dropdown components', function () { onClick = sinon.spy(); store = createMockStore(mockState) - component = shallowWithStore(h( + component = mountWithStore(h( Dropdown, dropdownComponentProps, [ @@ -57,7 +57,7 @@ describe('Dropdown components', function () { }, 'Item 2'), ] ), store) - dropdownComponent = component.dive() + dropdownComponent = component }) it('can render two items', function () { From 178b657c758229ccce0a13d9842197729847a9e0 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Sun, 26 Nov 2017 10:03:17 -0600 Subject: [PATCH 2/5] Update Qunit to QunitJS v2.4.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 27fea1495..3d4366fa7 100644 --- a/package.json +++ b/package.json @@ -224,7 +224,7 @@ "open": "0.0.5", "prompt": "^1.0.0", "qs": "^6.2.0", - "qunit": "^1.0.0", + "qunitjs": "^2.4.1", "react-addons-test-utils": "^15.5.1", "react-test-renderer": "^15.5.4", "react-testutils-additions": "^15.2.0", From 1ee91a51ccdaffd8990e56715f63fe2aca472398 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Sun, 26 Nov 2017 10:46:28 -0600 Subject: [PATCH 3/5] Update ethjs-query to v0.3.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3d4366fa7..8ca9b5211 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "ethjs": "^0.2.8", "ethjs-contract": "^0.1.9", "ethjs-ens": "^2.0.0", - "ethjs-query": "^0.2.9", + "ethjs-query": "^0.3.1", "express": "^4.15.5", "extension-link-enabler": "^1.0.0", "extensionizer": "^1.0.0", From 109050817a3074c57eb273a556b2a7bff0f87759 Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Mon, 27 Nov 2017 08:46:47 -0600 Subject: [PATCH 4/5] Update react, react-dom, and react-test-renderer to 15.6.2 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8ca9b5211..14090dffb 100644 --- a/package.json +++ b/package.json @@ -138,9 +138,9 @@ "pumpify": "^1.3.4", "qrcode-npm": "0.0.3", "ramda": "^0.24.1", - "react": "^15.0.2", + "react": "^15.6.2", "react-addons-css-transition-group": "^15.6.0", - "react-dom": "^15.5.4", + "react-dom": "^15.6.2", "react-hyperscript": "^3.0.0", "react-markdown": "^2.3.0", "react-redux": "^5.0.5", @@ -226,7 +226,7 @@ "qs": "^6.2.0", "qunitjs": "^2.4.1", "react-addons-test-utils": "^15.5.1", - "react-test-renderer": "^15.5.4", + "react-test-renderer": "^15.6.2", "react-testutils-additions": "^15.2.0", "redux-test-utils": "^0.1.3", "sinon": "^4.0.0", From 9b25f89728deabbdbeb7f7f0edd1b8cf4fd6e5bc Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Mon, 27 Nov 2017 12:35:19 -0600 Subject: [PATCH 5/5] Update babelify to 8.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 14090dffb..5b69587d9 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,7 @@ "babel-preset-react": "^6.24.1", "babel-preset-stage-0": "^6.24.1", "babel-register": "^6.7.2", - "babelify": "^7.2.0", + "babelify": "^8.0.0", "beefy": "^2.1.5", "brfs": "^1.4.3", "browserify": "^14.4.0",