Test viewer page

This commit is contained in:
Alexandre Iooss 2020-09-27 22:40:07 +02:00
parent 6c7ac2d3b3
commit 503fb2698b
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
1 changed files with 16 additions and 0 deletions

16
web/web_test.go Normal file
View File

@ -0,0 +1,16 @@
package web
import (
"net/http"
"net/http/httptest"
"testing"
)
func TestViewerPageGET(t *testing.T) {
r, _ := http.NewRequest("GET", "", nil)
w := httptest.NewRecorder()
http.HandlerFunc(viewerHandler).ServeHTTP(w, r)
if w.Code != http.StatusOK {
t.Errorf("Viewer page didn't return %v on GET", http.StatusOK)
}
}