git ssb

0+

Piet / ssb-loomio



Tree: 4ae9c2d21f4b6d8fc91aeb1a890c40180b8a4c7f

Files: 4ae9c2d21f4b6d8fc91aeb1a890c40180b8a4c7f / 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