mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:47:33 +00:00
chore: improve integration tests (#8727)
Improve integration tests: - spliting the tests in TokenExchange to isolated instances and in parallel - corrected some test structure so that the check for Details is no done anymore if the test already failed - replace required-calls with assert-calls to not stop the testing - add gofakeit for application, project and usernames(emails) - add eventually checks for testing in actions v2, so the request only get called when the execution is defined - check for length of results in list/search endpoints to avoid index errors
This commit is contained in:
@@ -335,17 +335,18 @@ func TestServer_SAMLACS(t *testing.T) {
|
||||
location, err := integration.CheckPost(callbackURL, httpPostFormRequest(relayState, response))
|
||||
if tt.wantErr {
|
||||
require.Error(t, err)
|
||||
} else {
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, relayState, location.Query().Get("id"))
|
||||
if tt.want.successful {
|
||||
assert.True(t, strings.HasPrefix(location.String(), tt.args.successURL))
|
||||
assert.NotEmpty(t, location.Query().Get("token"))
|
||||
assert.Equal(t, tt.want.user, location.Query().Get("user"))
|
||||
} else {
|
||||
assert.True(t, strings.HasPrefix(location.String(), tt.args.failureURL))
|
||||
}
|
||||
return
|
||||
}
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, relayState, location.Query().Get("id"))
|
||||
if tt.want.successful {
|
||||
assert.True(t, strings.HasPrefix(location.String(), tt.args.successURL))
|
||||
assert.NotEmpty(t, location.Query().Get("token"))
|
||||
assert.Equal(t, tt.want.user, location.Query().Get("user"))
|
||||
} else {
|
||||
assert.True(t, strings.HasPrefix(location.String(), tt.args.failureURL))
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user