Skip to content

Commit

Permalink
test(Open Issues): change NEW_DATA action type to PUSH_DATA
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardIvan committed Jul 10, 2016
1 parent 8a2f05f commit f0b9d50
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 72 deletions.
4 changes: 2 additions & 2 deletions app/js/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import visibleIssues from './rereduce-visible-issues'
import numberOfOpenIssues from './rereduce-open-issues'
import graphRange from './range-reducer.js'

import payingCustomers from './rereduce-paying-customers'
import graphData from './rereduce-graph-data'

const root = combineReducers({
issues,
Expand All @@ -36,7 +36,7 @@ const root = combineReducers({
visibleIssues,
numberOfOpenIssues,
graphRange,
payingCustomers,
graphData,
})

export default root
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* @flow */
/* @flow */
'use strict'

import moment from 'moment'
Expand All @@ -11,7 +11,7 @@ import {
PUSH_DATA,
} from '../actions'

const payingCustomersReducer = createReducer((state = Map(), action) => {
const graphData = createReducer((state = Map(), action) => {
switch (action.type) {
case INIT_LOAD:
return state.set('data', fromJS(action.payload.payingCustomersData))
Expand All @@ -28,4 +28,4 @@ const payingCustomersReducer = createReducer((state = Map(), action) => {
}
})

export default payingCustomersReducer
export default graphData
13 changes: 0 additions & 13 deletions app/js/reducers/rereduce-paying-customers-helpers.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/js/selectors/paying-customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import first from 'lodash/first'

// TODO test
export function getPayingCustomersData(state): Map {
return state.payingCustomers.get('data')
return state.graphData.get('data')
}

export function getLowestDates(data) {
Expand Down
49 changes: 0 additions & 49 deletions npm-debug.log

This file was deleted.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"_old_test": "babel-istanbul cover --report lcovonly ospec/bin/ospec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"_old_local-test": "babel-node ./ospec/bin/ospec",
"local-test": "node_modules/.bin/babel-node node_modules/.bin/_mocha --require ./tests/setup --require=env-test --recursive ./tests --color",
"local-test": "node_modules/.bin/babel-node node_modules/.bin/_mocha --full-trace --require ./tests/setup --require clarify --require=env-test --recursive ./tests --color --require mocha-clean/absolute_paths",
"local-test:watch": "npm run local-test -- --watch",
"_old_cover": "babel-node _isparta cover --report lcovonly ospec/bin/ospec",
"cover": "node_modules/.bin/babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/_mocha -- --require ./tests/setup --recursive ./tests",
Expand Down Expand Up @@ -48,6 +48,7 @@
"babel-preset-stage-2": "^6.5.0",
"babel-register": "^6.9.0",
"babel-runtime": "^6.9.2",
"clarify": "^2.0.0",
"classnames": "^2.2.5",
"coveralls": "^2.11.9",
"css-loader": "^0.23.1",
Expand Down Expand Up @@ -80,6 +81,7 @@
"mithril-query": "github:StephanHoyer/mithril-query.git#rewrite",
"mocha": "^2.5.3",
"mocha-as-promised": "^2.0.0",
"mocha-clean": "^1.0.0",
"mockaroo": "^0.1.7",
"moment": "^2.13.0",
"node-sass": "^3.7.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/app/js/reducers/open-issues.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('Open issues reducer', () => {
total: 0,
}))

action.type = "NEW_ISSUE"
action.type = "PUSH_DATA"

newState = reducer(state, action)

Expand Down
2 changes: 1 addition & 1 deletion tests/app/js/reducers/paying-customers-helpers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
lastMonthSum,
singleMonthSum,
fullMonthsTotals,
} from '../../../../app/js/reducers/rereduce-paying-customers-helpers'
} from '../../../../app/js/selectors/paying-customers'

// import {
// getPayingCustomersInRange,
Expand Down
2 changes: 1 addition & 1 deletion tests/app/js/reducers/paying-customers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import expect from 'expect'

import { Map, fromJS } from 'immutable'

import reducer from '../../../../app/js/reducers/rereduce-paying-customers'
import reducer from '../../../../app/js/reducers/rereduce-graph-data'

describe('Paying Customers Reducer', () => {

Expand Down

0 comments on commit f0b9d50

Please sign in to comment.