@@ -127,7 +127,8 @@ describe('TimeEntriesComponent', () => {
127127 } ) ) ;
128128
129129 it ( 'when create time entries, the time entries should be queried' , ( ) => {
130- const currentMonth = new Date ( ) . getMonth ( ) + 1 ;
130+ const currentMonth = new Date ( ) . getMonth ( ) ;
131+ const year = new Date ( ) . getFullYear ( ) ;
131132 const entryToSave = {
132133 entry : {
133134 project_id : 'project-id' ,
@@ -142,7 +143,7 @@ describe('TimeEntriesComponent', () => {
142143
143144 component . saveEntry ( entryToSave ) ;
144145 expect ( store . dispatch ) . toHaveBeenCalledWith ( new entryActions . CreateEntry ( entryToSave . entry ) ) ;
145- expect ( store . dispatch ) . toHaveBeenCalledWith ( new entryActions . LoadEntries ( currentMonth ) ) ;
146+ expect ( store . dispatch ) . toHaveBeenCalledWith ( new entryActions . LoadEntries ( currentMonth , year ) ) ;
146147 } ) ;
147148
148149 it ( 'when creating a new entry, then entryId should be null' , ( ) => {
@@ -324,11 +325,12 @@ describe('TimeEntriesComponent', () => {
324325 } ) ;
325326
326327 it ( 'should get the entry List by Month and year' , ( ) => {
327- const month = 1 ;
328- const year = 2020 ;
328+ const month = new Date ( ) . getMonth ( ) ;
329+ const year = new Date ( ) . getFullYear ( ) ;
330+
329331 spyOn ( store , 'dispatch' ) ;
330- component . dateSelected ( { monthIndex : month , year : 2020 } ) ;
331- expect ( store . dispatch ) . toHaveBeenCalledWith ( new entryActions . LoadEntries ( month ) ) ;
332+ component . dateSelected ( { monthIndex : month , year : year } ) ;
333+ expect ( store . dispatch ) . toHaveBeenCalledWith ( new entryActions . LoadEntries ( month + 1 , year ) ) ;
332334 } ) ;
333335
334336 it ( 'doSave when activeTimeEntry === null' , waitForAsync ( ( ) => {
0 commit comments