Test: Add test for api/preview
This commit is contained in:
parent
000735188c
commit
2509952992
1 changed files with 17 additions and 0 deletions
17
internal/api/preview_test.go
Normal file
17
internal/api/preview_test.go
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestGetPreview(t *testing.T) {
|
||||||
|
t.Run("invalid type", func(t *testing.T) {
|
||||||
|
app, router, ctx := NewApiTest()
|
||||||
|
GetPreview(router, ctx)
|
||||||
|
result := PerformRequest(app, "GET", "/api/v1/preview")
|
||||||
|
assert.Equal(t, http.StatusOK, result.Code)
|
||||||
|
})
|
||||||
|
}
|
Loading…
Reference in a new issue