GODT-35: Finish all details and make tests pass

This commit is contained in:
Michal Horejsek
2021-03-11 14:37:15 +01:00
committed by Jakub
parent 2284e9ede1
commit 8109831c07
173 changed files with 4697 additions and 2897 deletions

View File

@ -34,10 +34,6 @@ func UsersChecksFeatureContext(s *godog.Suite) {
s.Step(`^"([^"]*)" does not have loaded store$`, userDoesNotHaveLoadedStore)
s.Step(`^"([^"]*)" has running event loop$`, userHasRunningEventLoop)
s.Step(`^"([^"]*)" does not have running event loop$`, userDoesNotHaveRunningEventLoop)
// FIXME(conman): Write tests for new "auth" system.
// s.Step(`^"([^"]*)" does not have API auth$`, isNotAuthorized)
// s.Step(`^"([^"]*)" has API auth$`, isAuthorized)
}
func userHasAddressModeInMode(bddUserID, wantAddressMode string) error {
@ -158,36 +154,11 @@ func userDoesNotHaveRunningEventLoop(bddUserID string) error {
if err != nil {
return internalError(err, "getting store of %s", account.Username())
}
if store == nil {
return nil
}
a.Eventually(ctx.GetTestingT(), func() bool {
return store.TestGetEventLoop() == nil || !store.TestGetEventLoop().IsRunning()
}, 5*time.Second, 10*time.Millisecond)
return ctx.GetTestingError()
}
/*
func isAuthorized(bddUserID string) error {
account := ctx.GetTestAccount(bddUserID)
if account == nil {
return godog.ErrPending
}
user, err := ctx.GetUser(account.Username())
if err != nil {
return internalError(err, "getting user %s", account.Username())
}
a.Eventually(ctx.GetTestingT(), user.IsAuthorized, 5*time.Second, 10*time.Millisecond)
return ctx.GetTestingError()
}
func isNotAuthorized(bddUserID string) error {
account := ctx.GetTestAccount(bddUserID)
if account == nil {
return godog.ErrPending
}
user, err := ctx.GetUser(account.Username())
if err != nil {
return internalError(err, "getting user %s", account.Username())
}
a.Eventually(ctx.GetTestingT(), func() bool { return !user.IsAuthorized() }, 5*time.Second, 10*time.Millisecond)
return ctx.GetTestingError()
}
*/