mirror of https://github.com/dirtbags/moth.git
Compare commits
2 Commits
59a6aef007
...
c20cc1484f
Author | SHA1 | Date |
---|---|---|
Neale Pickett | c20cc1484f | |
Neale Pickett | 44dfbd43b5 |
|
@ -45,7 +45,7 @@ func TestHttpd(t *testing.T) {
|
|||
|
||||
if r := hs.TestRequest("/state", nil); r.Result().StatusCode != 200 {
|
||||
t.Error(r.Result())
|
||||
} else if r.Body.String() != `{"Config":{"Devel":false},"TeamNames":{},"PointsLog":[],"Puzzles":{}}` {
|
||||
} else if r.Body.String() != `{"Config":{"Devel":false},"Enabled":true,"TeamNames":{},"PointsLog":[],"Puzzles":{}}` {
|
||||
t.Error("Unexpected state", r.Body.String())
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ func TestHttpd(t *testing.T) {
|
|||
|
||||
if r := hs.TestRequest("/state", nil); r.Result().StatusCode != 200 {
|
||||
t.Error(r.Result())
|
||||
} else if r.Body.String() != `{"Config":{"Devel":false},"TeamNames":{"self":"GoTeam"},"PointsLog":[],"Puzzles":{"pategory":[1]}}` {
|
||||
} else if r.Body.String() != `{"Config":{"Devel":false},"Enabled":true,"TeamNames":{"self":"GoTeam"},"PointsLog":[],"Puzzles":{"pategory":[1]}}` {
|
||||
t.Error("Unexpected state", r.Body.String())
|
||||
}
|
||||
|
||||
|
|
|
@ -209,6 +209,7 @@ async function loadPuzzle(category, points) {
|
|||
async function init() {
|
||||
window.app = {}
|
||||
window.setanswer = (str => SetAnswer(str))
|
||||
window.checkAnswer = (str => window.app.puzzle.IsPossiblyCorrect(str))
|
||||
|
||||
for (let form of document.querySelectorAll("form.answer")) {
|
||||
form.addEventListener("submit", formSubmitHandler)
|
||||
|
|
Loading…
Reference in New Issue