mirror of
https://github.com/status-im/burnchart.git
synced 2025-02-09 09:03:52 +00:00
use fewer stubs, coverage goes up...
This commit is contained in:
parent
f3f3aacef2
commit
01589751ca
File diff suppressed because one or more lines are too long
@ -10,11 +10,11 @@
|
||||
|
||||
##Next Release
|
||||
|
||||
- [ ] make coverage work
|
||||
- [ ] http://burnchart.io#rails I would expect it to list all the projects for that owner so I can select one of them (Ryan); we could show a list of available project names with their: `description`, `private` flag and `has_issues` making the project greyed out if no issues found
|
||||
|
||||
##Backlog
|
||||
|
||||
- [ ] coverage using `blanket` does not work in tests that `proxyquire`
|
||||
- [ ] highlight today in the chart better
|
||||
- [ ] one click to go from a project or milestone view to github
|
||||
- [ ] be able to specify milestone by name (will nicely show in title)
|
||||
|
@ -44,6 +44,9 @@ calcSize = (list) ->
|
||||
# Issues without size (no matching labels) are not saved.
|
||||
!!issue.size
|
||||
|
||||
else
|
||||
throw 500
|
||||
|
||||
# Sync return.
|
||||
{ list, size }
|
||||
|
||||
|
@ -7,6 +7,9 @@ progress = (a, b) ->
|
||||
# Calculate the stats for a milestone.
|
||||
# Is it on time? What is the progress?
|
||||
module.exports = (milestone) ->
|
||||
# Makes testing easier...
|
||||
return milestone.stats if milestone.stats?
|
||||
|
||||
isDone = no ; isOnTime = yes ; isOverdue = no ; isEmpty = yes; points = 0
|
||||
|
||||
# Progress in points.
|
||||
|
@ -1,13 +1,8 @@
|
||||
proxy = do require('proxyquire').noCallThru
|
||||
assert = require 'assert'
|
||||
path = require 'path'
|
||||
|
||||
request = {}
|
||||
|
||||
issues = proxy path.resolve(__dirname, '../src/modules/github/issues.coffee'),
|
||||
'./request.coffee': request
|
||||
|
||||
config = require '../src/models/config.coffee'
|
||||
request = require '../src/modules/github/request.coffee'
|
||||
issues = require '../src/modules/github/issues.coffee'
|
||||
config = require '../src/models/config.coffee'
|
||||
|
||||
repo = { 'owner': 'radekstepan', 'name': 'burnchart', 'milestone': 1 }
|
||||
|
||||
|
@ -1,11 +1,6 @@
|
||||
proxy = do require('proxyquire').noCallThru
|
||||
assert = require 'assert'
|
||||
path = require 'path'
|
||||
_ = require 'lodash'
|
||||
|
||||
projects = proxy path.resolve(__dirname, '../src/models/projects.coffee'),
|
||||
# Just return the stats that are on the milestone already.
|
||||
'../modules/stats.coffee': ({ stats }) -> stats
|
||||
projects = require '../src/models/projects.coffee'
|
||||
|
||||
module.exports =
|
||||
|
||||
@ -17,7 +12,7 @@ module.exports =
|
||||
do projects.clear
|
||||
|
||||
project = { 'owner': 'radekstepan', 'name': 'burnchart' }
|
||||
milestone = 'title': '1.0.0'
|
||||
milestone = 'title': '1.0.0', 'stats': {}
|
||||
|
||||
projects.push 'list', project
|
||||
projects.addMilestone project, milestone
|
||||
@ -108,8 +103,8 @@ module.exports =
|
||||
projects.set 'sortBy', 'name'
|
||||
|
||||
project = { 'owner': 'radekstepan', 'name': 'burnchart' }
|
||||
milestone1 = 'title': 'B'
|
||||
milestone2 = 'title': 'A'
|
||||
milestone1 = 'title': 'B', 'stats': {}
|
||||
milestone2 = 'title': 'A', 'stats': {}
|
||||
|
||||
projects.push 'list', project
|
||||
projects.addMilestone project, milestone1
|
||||
@ -125,9 +120,9 @@ module.exports =
|
||||
projects.set 'sortBy', 'name'
|
||||
|
||||
project = { 'owner': 'radekstepan', 'name': 'burnchart' }
|
||||
milestone1 = 'title': '1.2.5'
|
||||
milestone2 = 'title': '1.1.x'
|
||||
milestone3 = 'title': '1.1.7'
|
||||
milestone1 = 'title': '1.2.5', 'stats': {}
|
||||
milestone2 = 'title': '1.1.x', 'stats': {}
|
||||
milestone3 = 'title': '1.1.7', 'stats': {}
|
||||
|
||||
projects.push 'list', project
|
||||
projects.addMilestone project, milestone1
|
||||
|
31
test/ractive.coffee
Normal file
31
test/ractive.coffee
Normal file
@ -0,0 +1,31 @@
|
||||
assert = require 'assert'
|
||||
|
||||
RactiveEventful = require '../src/utils/ractive/eventful.coffee'
|
||||
|
||||
module.exports = ->
|
||||
# This represents a way for mediator subscriptions to get cancelled.
|
||||
'mediator subscriptions get cancelled': (done) ->
|
||||
# Need to be able to deal with custom context.
|
||||
ctx = 'called': 0
|
||||
|
||||
view = new RactiveEventful
|
||||
|
||||
onconstruct: ->
|
||||
# Track how many times we get called.
|
||||
@subscribe '!event', ->
|
||||
@called += 1
|
||||
, ctx
|
||||
|
||||
onteardown: ->
|
||||
# Need to deal with multiple teardown handlers
|
||||
do this._super
|
||||
|
||||
do view.render()
|
||||
|
||||
view.publish '!event'
|
||||
assert.equal ctx.called, 1
|
||||
do view.teardown
|
||||
view.publish '!event'
|
||||
assert.equal ctx.called, 1
|
||||
|
||||
do done
|
Loading…
x
Reference in New Issue
Block a user