changelog, version up, tests

pull/663/head
hunterlong 2020-06-15 01:10:13 -07:00
parent ef60ba765c
commit 3d0e718ee1
4 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,10 @@
# 0.90.51 (06-15-2020)
- Fix Theme Editor codemirror inputs to show on load
- Added favicon folder for local assets can be used without remote access
- Modified Notifier's to return the response as a string for the frontend
- Modified Notifiers so they can use custom data for their request
- Added Notifier OnSuccess and onFailure custom data on frontend
# 0.90.50 (06-13-2020)
- Removed PORT, replaced with SERVER_PORT
- Removed HOST/IP, replaced with SERVER_IP

View File

@ -250,7 +250,7 @@ func TestMainApiRoutes(t *testing.T) {
`go_memstats_alloc_bytes`,
`http_duration_seconds_count`,
`http_response_bytes_count`,
`service_request_duration_count`,
`service_success`,
},
},
}

View File

@ -2,15 +2,17 @@ package notifiers
import (
"github.com/magiconair/properties/assert"
"github.com/statping/statping/types/failures"
"github.com/statping/statping/types/services"
"testing"
)
func TestReplaceTemplate(t *testing.T) {
temp := `{"id":{{.Service.Id}},"name":"{{.Service.Name}}"}`
replaced := ReplaceTemplate(temp, replacer{Service: exampleService})
assert.Equal(t, `{"id":1,"name":"Statping"}`, replaced)
replaced := ReplaceTemplate(temp, replacer{Service: services.Example(true)})
assert.Equal(t, `{"id":6283,"name":"Statping"}`, replaced)
temp = `{"id":{{.Service.Id}},"name":"{{.Service.Name}}","failure":"{{.Failure.Issue}}"}`
replaced = ReplaceTemplate(temp, replacer{Service: exampleService, Failure: exampleFailure})
assert.Equal(t, `{"id":1,"name":"Statping","failure":"HTTP returned a 500 status code"}`, replaced)
replaced = ReplaceTemplate(temp, replacer{Service: services.Example(false), Failure: failures.Example()})
assert.Equal(t, `{"id":6283,"name":"Statping","failure":"HTTP returned a 500 status code"}`, replaced)
}

View File

@ -1 +1 @@
0.90.50
0.90.51