@@ -36,6 +36,28 @@ func EndToEndBackendTest(t *testing.T, setup func() TestBackend, teardown func(b
36
36
require .Equal (t , "hello world" , output )
37
37
},
38
38
},
39
+ {
40
+ name : "SimpleWorkflow_ExpectedHistory" ,
41
+ f : func (t * testing.T , ctx context.Context , c client.Client , w worker.Worker , b TestBackend ) {
42
+ wf := func (ctx workflow.Context , msg string ) (string , error ) {
43
+ return msg + " world" , nil
44
+ }
45
+ register (t , ctx , w , []interface {}{wf }, nil )
46
+
47
+ instance := runWorkflow (t , ctx , c , wf , "hello" )
48
+
49
+ require .NoError (t , c .WaitForWorkflowInstance (ctx , instance , time .Second * 10 ))
50
+
51
+ events , err := b .GetWorkflowInstanceHistory (ctx , instance , nil )
52
+ require .NoError (t , err )
53
+
54
+ require .Equal (t , history .EventType_WorkflowTaskStarted , events [0 ].Type )
55
+ require .Equal (t , history .EventType_WorkflowExecutionStarted , events [1 ].Type )
56
+ require .Equal (t , int64 (0 ), events [1 ].ScheduleEventID )
57
+ require .Equal (t , history .EventType_WorkflowExecutionFinished , events [2 ].Type )
58
+ require .Equal (t , int64 (0 ), events [2 ].ScheduleEventID )
59
+ },
60
+ },
39
61
{
40
62
name : "UnregisteredWorkflow_Errors" ,
41
63
f : func (t * testing.T , ctx context.Context , c client.Client , w worker.Worker , b TestBackend ) {
0 commit comments