1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-07-15 02:04:17 +02:00

updated tests

This commit is contained in:
Gani Georgiev
2022-07-19 17:23:34 +03:00
parent 65697add43
commit ab5a770346
3 changed files with 23 additions and 5 deletions

View File

@ -4,6 +4,7 @@ import (
"net/http"
"strings"
"testing"
"time"
"github.com/labstack/echo/v5"
"github.com/pocketbase/dbx"
@ -94,6 +95,7 @@ func TestAdminRequestPasswordReset(t *testing.T) {
Method: http.MethodPost,
Url: "/api/admins/request-password-reset",
Body: strings.NewReader(`{"email":"missing@example.com"}`),
Delay: 100 * time.Millisecond,
ExpectedStatus: 204,
},
{
@ -101,6 +103,7 @@ func TestAdminRequestPasswordReset(t *testing.T) {
Method: http.MethodPost,
Url: "/api/admins/request-password-reset",
Body: strings.NewReader(`{"email":"test@example.com"}`),
Delay: 100 * time.Millisecond,
ExpectedStatus: 204,
ExpectedEvents: map[string]int{
"OnModelBeforeUpdate": 1,
@ -114,6 +117,7 @@ func TestAdminRequestPasswordReset(t *testing.T) {
Method: http.MethodPost,
Url: "/api/admins/request-password-reset",
Body: strings.NewReader(`{"email":"test@example.com"}`),
Delay: 100 * time.Millisecond,
ExpectedStatus: 204,
BeforeFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) {
// simulate recent password request