test(GODT-3220): Create function for getting the test user by address

GODT-3220
This commit is contained in:
Gjorgji Slamkov 2024-01-18 08:33:40 +01:00 committed by Gordana Zafirova
parent 7fa1948c21
commit 0ca07066db
1 changed files with 12 additions and 0 deletions

View File

@ -290,6 +290,18 @@ func (t *testCtx) getUserByID(userID string) *testUser {
return t.userByID[userID]
}
func (t *testCtx) getUserByAddress(email string) *testUser {
for _, user := range t.userByID {
for _, addr := range user.addresses {
if addr.email == email {
return user
}
}
}
panic(fmt.Sprintf("unknown email %q", email))
}
func (t *testCtx) getMBoxID(userID string, name string) string {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()