Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
fix encode plugin data unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoandredinis committed Oct 19, 2023
1 parent 9feaed9 commit c31e9cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions access/msteams/plugindata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ const messageData = "eyJpZCI6IkNIQU5ORUwxIiwidHMiOiIwMDAwMDAxIiwicmlkIjoiZm9vQGV
func TestEncodePluginData(t *testing.T) {
dataMap, err := EncodePluginData(samplePluginData)
assert.NoError(t, err)
assert.Len(t, dataMap, 7)
assert.GreaterOrEqual(t, len(dataMap), 8)
assert.Equal(t, "user-foo", dataMap["user"])
assert.Equal(t, "role-foo,role-bar", dataMap["roles"])
assert.Equal(t, "foo reason", dataMap["request_reason"])
assert.Equal(t, "3", dataMap["reviews_count"])
assert.Equal(t, "APPROVED", dataMap["resolution"])
assert.Equal(t, "foo ok", dataMap["resolve_reason"])
assert.Equal(t, "", dataMap["resources"])
assert.Equal(
t,
messageData,
Expand Down Expand Up @@ -90,7 +91,7 @@ func TestDecodePluginData(t *testing.T) {
func TestEncodeEmptyPluginData(t *testing.T) {
dataMap, err := EncodePluginData(PluginData{})
assert.NoError(t, err)
assert.Len(t, dataMap, 7)
assert.GreaterOrEqual(t, len(dataMap), 8)
for key, value := range dataMap {
assert.Emptyf(t, value, "value at key %q must be empty", key)
}
Expand Down

0 comments on commit c31e9cd

Please sign in to comment.