@@ -352,6 +352,7 @@ func TestListActions(t *testing.T) {
352352func  TestListGroupActions (t  * testing.T ) {
353353	t .Parallel ()
354354	ctx  :=  context .Background ()
355+ 	clock  :=  clock .NewTestClock (testTime1 )
355356
356357	group1  :=  intToSessionID (0 )
357358
@@ -360,9 +361,7 @@ func TestListGroupActions(t *testing.T) {
360361	index .AddPair (sessionID1 , group1 )
361362	index .AddPair (sessionID2 , group1 )
362363
363- 	db , err  :=  NewBoltDB (
364- 		t .TempDir (), "test.db" , index , clock .NewDefaultClock (),
365- 	)
364+ 	db , err  :=  NewBoltDB (t .TempDir (), "test.db" , index , clock )
366365	require .NoError (t , err )
367366	t .Cleanup (func () {
368367		_  =  db .Close ()
@@ -374,14 +373,18 @@ func TestListGroupActions(t *testing.T) {
374373	require .Empty (t , al )
375374
376375	// Add an action under session 1. 
377- 	_ , err  =  db .AddAction (ctx , action1Req )
376+ 	locator1 , err  :=  db .AddAction (ctx , action1Req )
377+ 	require .NoError (t , err )
378+ 	err  =  db .SetActionState (ctx , locator1 , ActionStateDone , "" )
378379	require .NoError (t , err )
379380
380381	// There should now be one action in the group. 
381382	al , _ , _ , err  =  db .ListActions (ctx , nil , WithActionGroupID (group1 ))
382383	require .NoError (t , err )
383384	require .Len (t , al , 1 )
384- 	require .Equal (t , sessionID1 , al [0 ].SessionID )
385+ 	assertEqualActions (t , action1 , al [0 ])
386+ 
387+ 	clock .SetTime (testTime2 )
385388
386389	// Add an action under session 2. 
387390	_ , err  =  db .AddAction (ctx , action2Req )
@@ -391,8 +394,8 @@ func TestListGroupActions(t *testing.T) {
391394	al , _ , _ , err  =  db .ListActions (ctx , nil , WithActionGroupID (group1 ))
392395	require .NoError (t , err )
393396	require .Len (t , al , 2 )
394- 	require . Equal (t , sessionID1 , al [0 ]. SessionID )
395- 	require . Equal (t , sessionID2 , al [1 ]. SessionID )
397+ 	assertEqualActions (t , action1 , al [0 ])
398+ 	assertEqualActions (t , action2 , al [1 ])
396399}
397400
398401func  assertEqualActions (t  * testing.T , expected , got  * Action ) {
0 commit comments