Convert all constructor calls for Problems

This commit is contained in:
Phoenix Eliot 2016-08-25 11:41:18 -07:00
parent 623f0ac8a5
commit ece071990c
2 changed files with 3 additions and 4 deletions

View file

@ -5,7 +5,6 @@ Range = ace.require('ace/range').Range
module.exports = class Problem
annotation: null
markerRange: null
# TODO: Convert calls to constructor to use object
constructor: ({ @aether, @aetherProblem, @ace, isCast=false, @levelID, error }) ->
if @aetherProblem
@annotation = @buildAnnotationFromAetherProblem(@aetherProblem)

View file

@ -29,7 +29,7 @@ describe 'Problem', ->
# TODO: Problems are no longer saved when creating Problems; instead it's in SpellView. Update tests?
xit 'save user code problem', ->
new Problem aether, aetherProblem, ace, false, true, levelID
new Problem {aether, aetherProblem, ace, isCast: false, levelID}
expect(jasmine.Ajax.requests.count()).toBe(1)
request = jasmine.Ajax.requests.mostRecent()
@ -49,7 +49,7 @@ describe 'Problem', ->
xit 'save user code problem no range', ->
aetherProblem.range = null
new Problem aether, aetherProblem, ace, false, true, levelID
new Problem {aether, aetherProblem, ace, isCast: false, levelID}
expect(jasmine.Ajax.requests.count()).toBe(1)
request = jasmine.Ajax.requests.mostRecent()
@ -73,7 +73,7 @@ describe 'Problem', ->
aether.raw = "this.say('hi');\nthis.sad\n('bye');"
aetherProblem.range = [ { row: 1 }, { row: 2 } ]
new Problem aether, aetherProblem, ace, false, true, levelID
new Problem {aether, aetherProblem, ace, isCast: false, levelID}
expect(jasmine.Ajax.requests.count()).toBe(1)
request = jasmine.Ajax.requests.mostRecent()