git ssb

0+

Piet / ssb-loomio



Commit 7a98d36437dd937d8d7daa45f726732c78c2ea33

Adds failing test

Piet Geursen committed on 3/6/2018, 2:06:34 AM
Parent: 6ff5525de64024e3f4384c5852534166d5c68063

Files changed

test/position/sync/chooseOneResults.test.jschanged
test/position/sync/chooseOneResults.test.jsView
@@ -28,10 +28,21 @@
2828 t.deepEqual(actual[2], [sallyId], 'correct voters for choice 2')
2929 t.end()
3030 })
3131
32-test.skip('Position - a position stated for an invalid choice index is not counted', function(t) {
32+test('Position - a position stated for an invalid choice index is not counted', function(t) {
33+ var validPoll = ChooseOne({
34+ choices: [1, 2, 'three'],
35+ title: 'how many food',
36+ closesAt: Date.now()
37+ })
3338
39+ const positions = [
40+ { value: { content: Position(ChooseOne({choice: 3, poll})), author: pietId } }
41+ ]
42+
43+ const actual = chooseOneResults({positions, poll: validPoll})
44+ t.false(actual[3], 'invalid vote is not counted')
3445 t.end()
3546 })
3647
3748 test.skip('Position - a position stated for an invalid choice index is included in the errors object', function(t) {

Built with git-ssb-web