diff --git a/package.json b/package.json index e535c5b..f078fb2 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,6 @@ "name": "geoshare", "version": "1.0.0", "description": "View tag filtered Instagram images in real time", - "engines": { - "iojs": "1.5.1" - }, "main": "app/app.js", "scripts": { "build": "webpack --config config/webpack/production.config.js --progress --profile --colors", @@ -27,51 +24,51 @@ }, "homepage": "https://github.com/troutowicz/geoshare", "dependencies": { - "alt": "0.16.10", - "autoprefixer-loader": "^2.0.0", - "babel": "^5.6.14", - "babel-loader": "^5.2.2", - "config": "^1.14.0", - "css-loader": "^0.15.1", + "alt": "^0.17.3", + "autoprefixer-loader": "^3.0.0", + "babel": "^5.8.23", + "babel-loader": "^5.3.2", + "config": "^1.16.0", + "css-loader": "^0.17.0", "extract-text-webpack-plugin": "^0.8.2", - "good": "^6.2.0", - "good-console": "^5.0.2", - "hapi-auth-cookie": "^3.0.1", - "hapi-shutdown": "^0.1.1", + "good": "^6.3.0", + "good-console": "^5.0.3", + "hapi-auth-cookie": "^3.1.0", + "hapi-shutdown": "^0.1.2", "html-loader": "^0.3.0", - "instagram-node": "^0.5.7", - "iso": "^4.1.0", + "instagram-node": "^0.5.8", + "iso": "^4.2.0", "json5": "^0.4.0", - "leaflet": "^0.7.3", - "leaflet.markercluster": "Leaflet/Leaflet.markercluster#v0.4.0-hotfix.1", + "leaflet": "^0.7.5", + "leaflet.markercluster": "Leaflet/Leaflet.markercluster#44bd117", "less": "^2.5.1", "less-loader": "^2.2.0", "material-ui": "0.9.0", "react": "^0.13.3", - "react-hot-loader": "^1.2.7", + "react-hot-loader": "^1.3.0", "react-leaflet": "^0.6.2", "react-tap-event-plugin": "^0.1.7", - "redis": "^0.12.1", - "socket.io": "^1.3.5", - "socket.io-client": "^1.3.5", + "redis": "^1.0.0", + "socket.io": "^1.3.6", + "socket.io-client": "^1.3.6", "stats-webpack-plugin": "0.1.2", "style-loader": "^0.12.3", "url-loader": "^0.5.6", - "webpack": "^1.10.0" + "webpack": "^1.12.1" }, "devDependencies": { - "babel-eslint": "^3.1.20", - "babelify": "^6.1.2", - "chai": "^3.0.0", - "eslint": "^0.24.0", - "eslint-plugin-react": "^2.6.3", - "mocha": "^2.2.5", - "mochify": "^2.10.0", - "phantomjs": "^1.9.17", + "babel-eslint": "^4.1.1", + "babelify": "^6.3.0", + "chai": "^3.2.0", + "eslint": "^1.3.1", + "eslint-plugin-react": "^3.3.1", + "mocha": "^2.3.2", + "mochify": "^2.13.0", + "phantomjs": "^1.9.18", "react-tools": "^0.13.3", "reactify": "^1.1.1", "rewire": "^2.3.4", - "sinon": "^1.15.4", + "sinon": "^1.16.1", "webpack-dev-server": "^1.10.1" } } diff --git a/test/app/stores/AppStore.js b/test/app/stores/AppStore.js index 7623fae..31c8009 100644 --- a/test/app/stores/AppStore.js +++ b/test/app/stores/AppStore.js @@ -1,30 +1,28 @@ 'use strict'; +import alt from '../../../app/alt'; +import AppActions from '../../../app/actions/AppActions'; import AppStore from '../../../app/stores/AppStore'; import { assert } from 'chai'; describe('AppStore', function () { before(function () { - this.UnwrappedStore = AppStore[Object.getOwnPropertySymbols(AppStore)[2]]; this.defaultState = AppStore.getState(); }); afterEach(function () { - this.UnwrappedStore.newImageData = this.defaultState.newImageData; - this.UnwrappedStore.imageData = this.defaultState.imageData; - this.UnwrappedStore.focusMarker = this.defaultState.focusMarker; - this.UnwrappedStore.flow = this.defaultState.flow; + alt.recycle(); }); describe('onUpdateInstaData()', function () { it('should update relevant app state', function () { const data = ['foo', 'bar']; + const action = AppActions.UPDATE_INSTA_DATA; - this.UnwrappedStore.onUpdateInstaData(data); + alt.dispatcher.dispatch({ action, data }); assert.deepEqual(AppStore.getState().newImageData, data); assert.deepEqual(AppStore.getState().imageData, data); assert.deepEqual(AppStore.getState().focusMarker, {}); - assert.equal(AppStore.getState().flow, this.defaultState.flow); }); }); @@ -32,10 +30,10 @@ describe('AppStore', function () { describe('onUpdateFocusedMarker()', function () { it('should update focusMarker state', function () { const data = 'foo'; + const action = AppActions.UPDATE_FOCUSED_MARKER; - this.UnwrappedStore.onUpdateFocusedMarker(data); + alt.dispatcher.dispatch({ action, data }); assert.equal(AppStore.getState().focusMarker, data); - assert.deepEqual(AppStore.getState().newImageData, this.defaultState.newImageData); assert.deepEqual(AppStore.getState().imageData, this.defaultState.imageData); assert.equal(AppStore.getState().flow, this.defaultState.flow); @@ -44,11 +42,11 @@ describe('AppStore', function () { describe('onUpdateFlowSuccess()', function () { it('should update flow state', function () { - const newFlow = 'Pause'; - - this.UnwrappedStore.onUpdateFlowSuccess(newFlow); - assert.equal(AppStore.getState().flow, newFlow); + const data = 'Resume'; + const action = AppActions.UPDATE_FLOW_SUCCESS; + alt.dispatcher.dispatch({ action, data }); + assert.equal(AppStore.getState().flow, data); assert.deepEqual(AppStore.getState().newImageData, this.defaultState.newImageData); assert.deepEqual(AppStore.getState().imageData, this.defaultState.imageData); assert.deepEqual(AppStore.getState().focusMarker, this.defaultState.focusMarker);