@@ -205,6 +205,29 @@ describe('TrackerState', () => {
205205 expect ( newState . items [ 'Deku Leaf' ] ) . toEqual ( 1 ) ;
206206 } ) ;
207207 } ) ;
208+
209+ describe ( 'when incrementing a blue chu' , ( ) => {
210+ beforeEach ( ( ) => {
211+ state = TrackerState . default ( ) ;
212+ } ) ;
213+
214+ test ( 'updates blue chu jelly count for a single blue chu' , ( ) => {
215+ const newState = state . incrementItem ( 'Blue Chu Underneath Boulder' ) ;
216+
217+ expect ( newState . items [ 'Blue Chu Underneath Boulder' ] ) . toEqual ( 1 ) ;
218+ expect ( newState . items [ 'Blue Chu Jelly' ] ) . toEqual ( 1 ) ;
219+ } ) ;
220+
221+ test ( 'updates blue chu jelly count for all blue chus' , ( ) => {
222+ let newState = state ;
223+ _ . forEach (
224+ _ . values ( LogicHelper . BLUE_CHU_ITEMS ) ,
225+ ( chu ) => { newState = newState . incrementItem ( chu ) ; } ,
226+ ) ;
227+
228+ expect ( newState . items [ 'Blue Chu Jelly' ] ) . toEqual ( 23 ) ;
229+ } ) ;
230+ } ) ;
208231 } ) ;
209232
210233 describe ( 'decrementItem' , ( ) => {
@@ -245,6 +268,27 @@ describe('TrackerState', () => {
245268 expect ( newState . items [ 'Deku Leaf' ] ) . toEqual ( 0 ) ;
246269 } ) ;
247270 } ) ;
271+
272+ describe ( 'when decrementing a blue chu' , ( ) => {
273+ beforeEach ( ( ) => {
274+ state = TrackerState . default ( ) ;
275+ state . items [ 'Blue Chu Underneath Boulder' ] = 1 ;
276+ state . items [ 'Blue Chu on Top of Island' ] = 1 ;
277+ state . items [ 'Blue Chu Jelly' ] = 2 ;
278+ } ) ;
279+
280+ test ( 'updates blue chu jelly count' , ( ) => {
281+ const newState = state . decrementItem ( 'Blue Chu Underneath Boulder' ) ;
282+
283+ expect ( newState . items [ 'Blue Chu Underneath Boulder' ] ) . toEqual ( 0 ) ;
284+ expect ( newState . items [ 'Blue Chu Jelly' ] ) . toEqual ( 1 ) ;
285+
286+ const newStateAfterSecondDecrement = newState . decrementItem ( 'Blue Chu on Top of Island' ) ;
287+
288+ expect ( newStateAfterSecondDecrement . items [ 'Blue Chu on Top of Island' ] ) . toEqual ( 0 ) ;
289+ expect ( newStateAfterSecondDecrement . items [ 'Blue Chu Jelly' ] ) . toEqual ( 0 ) ;
290+ } ) ;
291+ } ) ;
248292 } ) ;
249293
250294 describe ( 'getEntranceForExit' , ( ) => {
@@ -856,27 +900,4 @@ describe('TrackerState', () => {
856900 } ) ;
857901 } ) ;
858902 } ) ;
859-
860- describe ( 'getMarkedBlueChuCount' , ( ) => {
861- let state ;
862- const allChuItems = _ . values ( LogicHelper . BLUE_CHU_ITEMS ) ;
863-
864- beforeEach ( ( ) => {
865- state = new TrackerState ( ) ;
866- state . items = Object . fromEntries ( allChuItems . map ( ( chu ) => [ chu , 0 ] ) ) ;
867- } ) ;
868-
869- test ( 'counts a marked blue chu' , ( ) => {
870- const newState = state . incrementItem ( 'Blue Chu Underneath Boulder' ) ;
871-
872- expect ( newState . getMarkedBlueChuCount ( ) ) . toEqual ( 1 ) ;
873- } ) ;
874-
875- test ( 'counts every blue chu' , ( ) => {
876- let newState = state ;
877- _ . forEach ( allChuItems , ( chu ) => { newState = newState . incrementItem ( chu ) ; } ) ;
878-
879- expect ( newState . getMarkedBlueChuCount ( ) ) . toEqual ( 23 ) ;
880- } ) ;
881- } ) ;
882903} ) ;
0 commit comments