Files
backend/tests/04_getAliases_test.go
Yi-Ting Shih 47f09b733a
All checks were successful
Go test / run-go-vet (push) Successful in 20s
Go test / check-swagger-up-to-date (push) Successful in 9s
Go test / run-go-test (push) Successful in 47s
Go test / cleanup-go-test (push) Successful in 4s
Go test / release-image (push) Successful in 3m35s
Refactor: migrate discordbot
2025-12-13 04:58:12 +08:00

27 lines
439 B
Go

package tests
import (
"net/http"
"testing"
)
type aliasPayload struct {
Id int64 `json:"id"`
Name string `json:"name"`
}
var aliases []aliasPayload
func Test_04_GetAliases(t *testing.T) {
resp, err := client.R().
SetResult(&aliases).
Get("/api/aliases")
if err != nil || resp.StatusCode() != http.StatusOK {
t.Logf("%+v", resp)
t.Fatal("failed to get aliases")
}
if len(aliases) == 0 {
t.Fatal("no aliases")
}
}