mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
Refactor schedule JS to be less buggy (fixes #12).
This commit is contained in:
@@ -27,10 +27,6 @@ func (web *Web) scheduleGetHandler(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if len(cachedScheduleBlocks) == 0 {
|
||||
tomorrow := time.Now().AddDate(0, 0, 1)
|
||||
location, _ := time.LoadLocation("Local")
|
||||
startTime := time.Date(tomorrow.Year(), tomorrow.Month(), tomorrow.Day(), 9, 0, 0, 0, location)
|
||||
cachedScheduleBlocks = append(cachedScheduleBlocks, tournament.ScheduleBlock{startTime, 10, 360})
|
||||
cachedMatchType = "practice"
|
||||
}
|
||||
web.renderSchedule(w, r, "")
|
||||
|
||||
@@ -20,7 +20,7 @@ func TestSetupSchedule(t *testing.T) {
|
||||
// Check the default setting values.
|
||||
recorder := web.getHttpResponse("/setup/schedule")
|
||||
assert.Equal(t, 200, recorder.Code)
|
||||
assert.Contains(t, recorder.Body.String(), "360") // The default match spacing.
|
||||
assert.Contains(t, recorder.Body.String(), "addBlock();")
|
||||
|
||||
// Submit a schedule for generation.
|
||||
postData := "numScheduleBlocks=3&startTime0=2014-01-01 09:00:00 AM&numMatches0=7&matchSpacingSec0=480&" +
|
||||
|
||||
Reference in New Issue
Block a user