BuildTest: show notification of results
This commit is contained in:
parent
b4f2abde15
commit
227d6a2049
@ -30,6 +30,7 @@ BuildTest =
|
|||||||
return [x2, y2]
|
return [x2, y2]
|
||||||
|
|
||||||
runTest: (post) ->
|
runTest: (post) ->
|
||||||
|
BuildTest.postsRemaining++
|
||||||
$.cache "//a.4cdn.org/#{post.board.ID}/thread/#{post.thread.ID}.json", ->
|
$.cache "//a.4cdn.org/#{post.board.ID}/thread/#{post.thread.ID}.json", ->
|
||||||
{posts} = @response
|
{posts} = @response
|
||||||
Build.spoilerRange[post.board.ID] = posts[0].custom_spoiler
|
Build.spoilerRange[post.board.ID] = posts[0].custom_spoiler
|
||||||
@ -43,14 +44,27 @@ BuildTest =
|
|||||||
c.log "#{post.fullID} correct"
|
c.log "#{post.fullID} correct"
|
||||||
else
|
else
|
||||||
c.log "#{post.fullID} differs"
|
c.log "#{post.fullID} differs"
|
||||||
|
BuildTest.postsFailed++
|
||||||
[x2, y2] = BuildTest.firstDiff x, y
|
[x2, y2] = BuildTest.firstDiff x, y
|
||||||
c.log x2
|
c.log x2
|
||||||
c.log y2
|
c.log y2
|
||||||
c.log x.outerHTML
|
c.log x.outerHTML
|
||||||
c.log y.outerHTML
|
c.log y.outerHTML
|
||||||
|
BuildTest.postsRemaining--
|
||||||
|
BuildTest.report() if BuildTest.postsRemaining is 0
|
||||||
post2.isFetchedQuote = true
|
post2.isFetchedQuote = true
|
||||||
Main.callbackNodes Post, [post2]
|
Main.callbackNodes Post, [post2]
|
||||||
|
|
||||||
|
postsRemaining: 0
|
||||||
|
postsFailed: 0
|
||||||
|
|
||||||
|
report: ->
|
||||||
|
if BuildTest.postsFailed
|
||||||
|
new Notice 'warning', "#{BuildTest.postsFailed} post(s) differ", 30
|
||||||
|
else
|
||||||
|
new Notice 'success', 'All correct', 5
|
||||||
|
BuildTest.postsFailed = 0
|
||||||
|
|
||||||
testOne: ->
|
testOne: ->
|
||||||
BuildTest.runTest g.posts[@dataset.fullID]
|
BuildTest.runTest g.posts[@dataset.fullID]
|
||||||
Menu.menu.close()
|
Menu.menu.close()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user