mirror of
https://github.com/zitadel/zitadel.git
synced 2025-06-21 17:48:35 +00:00
test: session v2beta corrected like v2 (#9350)
# Which Problems Are Solved Ordering of sessions in v2beta is still relevant in the integration tests. # How the Problems Are Solved Correct the integration tests on session service v2beta like in v2. # Additional Changes None # Additional Context Failing integration tests in pipeline.
This commit is contained in:
parent
840da5be2d
commit
39a7977e34
@ -493,6 +493,12 @@ func TestServer_ListSessions(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// expected count of sessions is not equal to created dependencies
|
||||||
|
if !assert.Len(ttt, tt.want.Sessions, len(infos)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// expected count of sessions is not equal to received sessions
|
||||||
if !assert.Equal(ttt, got.Details.TotalResult, tt.want.Details.TotalResult) || !assert.Len(ttt, got.Sessions, len(tt.want.Sessions)) {
|
if !assert.Equal(ttt, got.Details.TotalResult, tt.want.Details.TotalResult) || !assert.Len(ttt, got.Sessions, len(tt.want.Sessions)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -503,8 +509,17 @@ func TestServer_ListSessions(t *testing.T) {
|
|||||||
tt.want.Sessions[i].CreationDate = infos[i].Details.GetChangeDate()
|
tt.want.Sessions[i].CreationDate = infos[i].Details.GetChangeDate()
|
||||||
tt.want.Sessions[i].ChangeDate = infos[i].Details.GetChangeDate()
|
tt.want.Sessions[i].ChangeDate = infos[i].Details.GetChangeDate()
|
||||||
|
|
||||||
verifySession(ttt, got.Sessions[i], tt.want.Sessions[i], time.Minute, tt.wantExpirationWindow, infos[i].UserID, tt.wantFactors...)
|
// only check for contents of the session, not sorting for now
|
||||||
|
found := false
|
||||||
|
for _, session := range got.Sessions {
|
||||||
|
if session.Id == infos[i].ID {
|
||||||
|
verifySession(ttt, session, tt.want.Sessions[i], time.Minute, tt.wantExpirationWindow, infos[i].UserID, tt.wantFactors...)
|
||||||
|
found = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert.True(t, found)
|
||||||
}
|
}
|
||||||
|
|
||||||
integration.AssertListDetails(ttt, tt.want, got)
|
integration.AssertListDetails(ttt, tt.want, got)
|
||||||
}, retryDuration, tick)
|
}, retryDuration, tick)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user