MM-52792: Update createPost, updatePost, & patchPost (#24195)

Этот коммит содержится в:
Caleb Roseland
2023-10-03 09:51:07 -05:00
коммит произвёл GitHub
родитель f3f9a84456
Коммит b7f1a7f262
8 изменённых файлов: 249 добавлений и 13 удалений

Просмотреть файл

@@ -133,3 +133,23 @@ func TestSessionIsOAuthUser(t *testing.T) {
})
}
}
func TestIsIntegration(t *testing.T) {
testCases := []struct {
Description string
Session Session
IsIntegration bool
}{
{"False on empty props", Session{}, false},
{"True when is OAuth App", Session{IsOAuth: true}, true},
{"True when session is bot", Session{Props: StringMap{SessionPropIsBot: SessionPropIsBotValue}}, true},
{"True when session is user access token", Session{Props: StringMap{SessionPropType: SessionTypeUserAccessToken}}, true},
{"Not affected by Props[UserAuthServiceIsOAuth]", Session{Props: StringMap{UserAuthServiceIsOAuth: strconv.FormatBool(true)}}, false},
}
for _, tc := range testCases {
t.Run(tc.Description, func(t *testing.T) {
require.Equal(t, tc.IsIntegration, tc.Session.IsIntegration())
})
}
}