Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
Yuri Shkuro committed Oct 24, 2017
1 parent 171e303 commit b026119
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/query/app/fixture/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<html lang="en">
<meta charset="UTF-8">
<title>Test Page</title>
<!-- JAEGER_CONFIG=DEFAULT_CONFIG; -->
</html>
12 changes: 12 additions & 0 deletions cmd/query/app/static_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -75,6 +76,17 @@ func TestRegisterRoutesHandler(t *testing.T) {
assert.Equal(t, expectedRespString, respString)
}

func TestNewStaticAssetsHandlerWithConfig(t *testing.T) {
_, err := NewStaticAssetsHandler("fixture", "fixture/invalid-config")
assert.Error(t, err)

handler, err := NewStaticAssetsHandler("fixture", "fixture/ui-config.json")
require.NoError(t, err)
require.NotNil(t, handler)
html := string(handler.indexHTML)
assert.True(t, strings.Contains(html, `JAEGER_CONFIG = {"x":"y"};`), "actual: %v", html)
}

func TestLoadUIConfig(t *testing.T) {
type testCase struct {
configFile string
Expand Down

0 comments on commit b026119

Please sign in to comment.