@@ -10,7 +10,7 @@ describe('<FuelSavingsForm />', () => {
1010 it ( 'should contain <FuelSavingsTextInput /> components' , ( ) => {
1111 const saveFuelSavings = ( ) => { } ;
1212 const calculateFuelSavings = ( ) => { } ;
13- const appState = {
13+ const fuelSavings = {
1414 newMpg : 20 ,
1515 tradeMpg : 10 ,
1616 newPpg : 1.50 ,
@@ -30,27 +30,27 @@ describe('<FuelSavingsForm />', () => {
3030 const wrapper = shallow ( < FuelSavingsForm
3131 saveFuelSavings = { saveFuelSavings }
3232 calculateFuelSavings = { calculateFuelSavings }
33- appState = { appState }
33+ fuelSavings = { fuelSavings }
3434 /> ) ;
3535 const allInputs = wrapper . find ( FuelSavingsTextInput ) ;
3636
3737 expect ( allInputs ) . to . be . length ( 5 ) ;
3838 expect ( allInputs . at ( 0 ) . props ( ) . name ) . to . equal ( 'newMpg' ) ;
39- expect ( allInputs . at ( 0 ) . props ( ) . value ) . to . equal ( appState . newMpg ) ;
39+ expect ( allInputs . at ( 0 ) . props ( ) . value ) . to . equal ( fuelSavings . newMpg ) ;
4040 expect ( allInputs . at ( 1 ) . props ( ) . name ) . to . equal ( 'tradeMpg' ) ;
41- expect ( allInputs . at ( 1 ) . props ( ) . value ) . to . equal ( appState . tradeMpg ) ;
41+ expect ( allInputs . at ( 1 ) . props ( ) . value ) . to . equal ( fuelSavings . tradeMpg ) ;
4242 expect ( allInputs . at ( 2 ) . props ( ) . name ) . to . equal ( 'newPpg' ) ;
43- expect ( allInputs . at ( 2 ) . props ( ) . value ) . to . equal ( appState . newPpg ) ;
43+ expect ( allInputs . at ( 2 ) . props ( ) . value ) . to . equal ( fuelSavings . newPpg ) ;
4444 expect ( allInputs . at ( 3 ) . props ( ) . name ) . to . equal ( 'tradePpg' ) ;
45- expect ( allInputs . at ( 3 ) . props ( ) . value ) . to . equal ( appState . tradePpg ) ;
45+ expect ( allInputs . at ( 3 ) . props ( ) . value ) . to . equal ( fuelSavings . tradePpg ) ;
4646 expect ( allInputs . at ( 4 ) . props ( ) . name ) . to . equal ( 'milesDriven' ) ;
47- expect ( allInputs . at ( 4 ) . props ( ) . value ) . to . equal ( appState . milesDriven ) ;
47+ expect ( allInputs . at ( 4 ) . props ( ) . value ) . to . equal ( fuelSavings . milesDriven ) ;
4848 } ) ;
4949
5050 it ( 'should contain options to change miles driven timeframe' , ( ) => {
5151 const saveFuelSavings = ( ) => { } ;
5252 const calculateFuelSavings = ( ) => { } ;
53- const appState = {
53+ const fuelSavings = {
5454 newMpg : 20 ,
5555 tradeMpg : 10 ,
5656 newPpg : 1.50 ,
@@ -70,7 +70,7 @@ describe('<FuelSavingsForm />', () => {
7070 const wrapper = shallow ( < FuelSavingsForm
7171 saveFuelSavings = { saveFuelSavings }
7272 calculateFuelSavings = { calculateFuelSavings }
73- appState = { appState }
73+ fuelSavings = { fuelSavings }
7474 /> ) ;
7575 const expectedOption1 = '<option value="week">Week</option>' ;
7676 const expectedOption2 = '<option value="month">Month</option>' ;
@@ -84,7 +84,7 @@ describe('<FuelSavingsForm />', () => {
8484 it ( 'should contain <FuelSavingsResults /> when necessary conditions are met' , ( ) => {
8585 const saveFuelSavings = ( ) => { } ;
8686 const calculateFuelSavings = ( ) => { } ;
87- const appState = {
87+ const fuelSavings = {
8888 newMpg : 20 ,
8989 tradeMpg : 10 ,
9090 newPpg : 1.50 ,
@@ -104,17 +104,17 @@ describe('<FuelSavingsForm />', () => {
104104 const wrapper = shallow ( < FuelSavingsForm
105105 saveFuelSavings = { saveFuelSavings }
106106 calculateFuelSavings = { calculateFuelSavings }
107- appState = { appState }
107+ fuelSavings = { fuelSavings }
108108 /> ) ;
109- const expected = < FuelSavingsResults savings = { appState . savings } /> ;
109+ const expected = < FuelSavingsResults savings = { fuelSavings . savings } /> ;
110110
111111 expect ( wrapper . contains ( expected ) ) . to . be . true ;
112112 } ) ;
113113
114114 it ( 'should not contain <FuelSavingsResults /> when necessary conditions are not met' , ( ) => {
115115 const saveFuelSavings = ( ) => { } ;
116116 const calculateFuelSavings = ( ) => { } ;
117- const appState = {
117+ const fuelSavings = {
118118 newMpg : 20 ,
119119 tradeMpg : 10 ,
120120 newPpg : 1.50 ,
@@ -134,17 +134,17 @@ describe('<FuelSavingsForm />', () => {
134134 const wrapper = shallow ( < FuelSavingsForm
135135 saveFuelSavings = { saveFuelSavings }
136136 calculateFuelSavings = { calculateFuelSavings }
137- appState = { appState }
137+ fuelSavings = { fuelSavings }
138138 /> ) ;
139- const expected = < FuelSavingsResults savings = { appState . savings } /> ;
139+ const expected = < FuelSavingsResults savings = { fuelSavings . savings } /> ;
140140
141141 expect ( wrapper . contains ( expected ) ) . to . be . false ;
142142 } ) ;
143143
144144 it ( 'should handle form submit' , ( ) => {
145145 const saveFuelSavings = sinon . spy ( ) ;
146146 const calculateFuelSavings = ( ) => { } ;
147- const appState = {
147+ const fuelSavings = {
148148 newMpg : 20 ,
149149 tradeMpg : 10 ,
150150 newPpg : 1.50 ,
@@ -164,7 +164,7 @@ describe('<FuelSavingsForm />', () => {
164164 const wrapper = shallow ( < FuelSavingsForm
165165 saveFuelSavings = { saveFuelSavings }
166166 calculateFuelSavings = { calculateFuelSavings }
167- appState = { appState }
167+ fuelSavings = { fuelSavings }
168168 /> ) ;
169169
170170 expect ( saveFuelSavings . calledOnce ) . to . be . false ;
@@ -175,7 +175,7 @@ describe('<FuelSavingsForm />', () => {
175175 it ( 'should submit appState' , ( ) => {
176176 const saveFuelSavings = sinon . spy ( ) ;
177177 const calculateFuelSavings = ( ) => { } ;
178- const appState = {
178+ const fuelSavings = {
179179 newMpg : 20 ,
180180 tradeMpg : 10 ,
181181 newPpg : 1.50 ,
@@ -195,18 +195,18 @@ describe('<FuelSavingsForm />', () => {
195195 const wrapper = shallow ( < FuelSavingsForm
196196 saveFuelSavings = { saveFuelSavings }
197197 calculateFuelSavings = { calculateFuelSavings }
198- appState = { appState }
198+ fuelSavings = { fuelSavings }
199199 /> ) ;
200200
201201 wrapper . find ( 'input[type="submit"]' ) . simulate ( 'click' ) ;
202- expect ( saveFuelSavings . args [ 0 ] [ 0 ] ) . to . equal ( appState ) ;
202+ expect ( saveFuelSavings . args [ 0 ] [ 0 ] ) . to . equal ( fuelSavings ) ;
203203 } ) ;
204204
205205
206206 it ( 'should calculate fuel savings on text input change' , ( ) => {
207207 const saveFuelSavings = ( ) => { } ;
208208 const calculateFuelSavings = sinon . spy ( ) ;
209- const appState = {
209+ const fuelSavings = {
210210 newMpg : 20 ,
211211 tradeMpg : 10 ,
212212 newPpg : 1.50 ,
@@ -226,7 +226,7 @@ describe('<FuelSavingsForm />', () => {
226226 const wrapper = shallow ( < FuelSavingsForm
227227 saveFuelSavings = { saveFuelSavings }
228228 calculateFuelSavings = { calculateFuelSavings }
229- appState = { appState }
229+ fuelSavings = { fuelSavings }
230230 /> ) ;
231231
232232 expect ( calculateFuelSavings . calledOnce ) . to . be . false ;
@@ -237,7 +237,7 @@ describe('<FuelSavingsForm />', () => {
237237 it ( 'should calculate fuel savings on miles driven timeframe change' , ( ) => {
238238 const saveFuelSavings = ( ) => { } ;
239239 const calculateFuelSavings = sinon . spy ( ) ;
240- const appState = {
240+ const fuelSavings = {
241241 newMpg : 20 ,
242242 tradeMpg : 10 ,
243243 newPpg : 1.50 ,
@@ -257,7 +257,7 @@ describe('<FuelSavingsForm />', () => {
257257 const wrapper = shallow ( < FuelSavingsForm
258258 saveFuelSavings = { saveFuelSavings }
259259 calculateFuelSavings = { calculateFuelSavings }
260- appState = { appState }
260+ fuelSavings = { fuelSavings }
261261 /> ) ;
262262
263263 expect ( calculateFuelSavings . calledOnce ) . to . be . false ;
0 commit comments