Skip to content

Commit

Permalink
Add check for event data
Browse files Browse the repository at this point in the history
  • Loading branch information
krhubert committed Oct 29, 2019
1 parent f4ec9c0 commit cf38c7a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions e2e/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/mesg-foundation/engine/protobuf/acknowledgement"
pb "github.com/mesg-foundation/engine/protobuf/api"
"github.com/mesg-foundation/engine/protobuf/types"
"github.com/stretchr/testify/require"
)

Expand All @@ -19,6 +20,15 @@ func testEvent(t *testing.T) {
resp, err := client.EventClient.Create(context.Background(), &pb.CreateEventRequest{
InstanceHash: testInstanceHash,
Key: "ping_ok",
Data: &types.Struct{
Fields: map[string]*types.Value{
"msg": &types.Value{
Kind: &types.Value_StringValue{
StringValue: "foo",
},
},
},
},
})
require.NoError(t, err)

Expand All @@ -28,4 +38,5 @@ func testEvent(t *testing.T) {
require.Equal(t, resp.Hash, event.Hash)
require.Equal(t, testInstanceHash, event.InstanceHash)
require.Equal(t, "ping_ok", event.Key)
require.Equal(t, "foo", event.Data.Fields["msg"].GetStringValue())
}

0 comments on commit cf38c7a

Please sign in to comment.