You've already forked pocketbase
mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-11-30 00:58:30 +02:00
run added password reset and verification sent hooks tests
This commit is contained in:
@@ -27,7 +27,7 @@ type ApiScenario struct {
|
||||
ExpectedContent []string
|
||||
NotExpectedContent []string
|
||||
ExpectedEvents map[string]int
|
||||
// test events
|
||||
// test hooks
|
||||
BeforeFunc func(t *testing.T, app *TestApp, e *echo.Echo)
|
||||
AfterFunc func(t *testing.T, app *TestApp, e *echo.Echo)
|
||||
}
|
||||
@@ -81,6 +81,12 @@ func (scenario *ApiScenario) Test(t *testing.T) {
|
||||
t.Errorf("[%s] Expected status code %d, got %d", prefix, scenario.ExpectedStatus, res.StatusCode)
|
||||
}
|
||||
|
||||
// @todo consider replacing with sync.WaitGroup
|
||||
//
|
||||
// apply a small delay before checking the expectations to ensure
|
||||
// that all fired go routines have complicated before cleaning up the app instance
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
|
||||
if len(scenario.ExpectedContent) == 0 && len(scenario.NotExpectedContent) == 0 {
|
||||
if len(recorder.Body.Bytes()) != 0 {
|
||||
t.Errorf("[%s] Expected empty body, got \n%v", prefix, recorder.Body.String())
|
||||
|
||||
Reference in New Issue
Block a user