git ssb

0+

Piet / ssb-loomio



Tree: d022ea7ba118fcb624a4afe57ec5b1be07d30313

Files: d022ea7ba118fcb624a4afe57ec5b1be07d30313 / test / position / sync / isPosition.test.js

700 bytesRaw
1const test = require('tape')
2const isPosition = require('../../../isPosition')
3const { CHOOSE_ONE } = require('../../../types')
4
5// this is for testing the attributes that are required for all polls
6test('position - common requirements', function (t) {
7 var missingDetails = {
8 type: 'position',
9 poll: '%t+PhrNxxXkw/jMo6mnwUWfFjJapoPWxzsQoe0Np+nYw=.sha256',
10 positionDetails: undefined
11 }
12 t.false(isPosition(missingDetails), 'needs details')
13 t.true(isPosition.errors, 'failing validations have errors')
14
15 var missingPoll = {
16 type: 'position',
17 positionDetails: {
18 type: CHOOSE_ONE,
19 choice: 0
20 }
21 }
22 t.false(isPosition(missingPoll), 'needs poll')
23
24 t.end()
25})
26

Built with git-ssb-web