git ssb

0+

Piet / ssb-loomio



Commit be17b27d1ff6966e3d7d922f5e612f4d2477dce4

Adds failing test.

Piet Geursen committed on 3/8/2018, 10:57:49 PM
Parent: 829c28e4dcb2845cd8b4e4737cfe0bd196ffcaef

Files changed

test/position/sync/chooseOneResults.test.jschanged
test/position/sync/chooseOneResults.test.jsView
@@ -35,12 +35,37 @@
3535 { value: { content: ChooseOne({choice: 1, poll}), author: tommyId } },
3636 { value: { content: ChooseOne({choice: 2, poll}), author: sallyId } }
3737 ]
3838
39 + const expected = {
40 + results: [
41 + {
42 + choice: '1',
43 + voters: {
44 + [pietId]: positions[0],
45 + [mixId]: positions[1],
46 + [mikeyId]: positions[2]
47 + }
48 + },
49 + {
50 + choice: '2',
51 + voters: {
52 + [timmyId]: positions[3],
53 + [tommyId]: positions[4]
54 + }
55 + },
56 + {
57 + choice: 'three',
58 + voters: {
59 + [sallyId]: positions[5]
60 + }
61 + }
62 + ],
63 + errors: {}
64 + }
65 +
3966 const actual = chooseOneResults({positions, poll: validPoll})
40- t.deepEqual(actual[0], [pietId, mixId, mikeyId], 'correct voters for choice 0')
41- t.deepEqual(actual[1], [timmyId, tommyId], 'correct voters for choice 1')
42- t.deepEqual(actual[2], [sallyId], 'correct voters for choice 2')
67 + t.deepEqual(actual, expected, 'results are correct')
4368 t.end()
4469 })
4570
4671 test('ChooseOneResults - a position stated for an invalid choice index is not counted', function (t) {

Built with git-ssb-web