Commit 7a98d36437dd937d8d7daa45f726732c78c2ea33
Adds failing test
Piet Geursen committed on 3/6/2018, 2:06:34 AMParent: 6ff5525de64024e3f4384c5852534166d5c68063
Files changed
test/position/sync/chooseOneResults.test.js | changed |
test/position/sync/chooseOneResults.test.js | ||
---|---|---|
@@ -28,10 +28,21 @@ | ||
28 | 28 | t.deepEqual(actual[2], [sallyId], 'correct voters for choice 2') |
29 | 29 | t.end() |
30 | 30 | }) |
31 | 31 | |
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 | + }) | |
33 | 38 | |
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') | |
34 | 45 | t.end() |
35 | 46 | }) |
36 | 47 | |
37 | 48 | test.skip('Position - a position stated for an invalid choice index is included in the errors object', function(t) { |
Built with git-ssb-web