git ssb

0+

Piet / ssb-loomio



Tree: 37adf78cdbbd4382daca8b71e27337cdacfe5570

Files: 37adf78cdbbd4382daca8b71e27337cdacfe5570 / test / position / sync / isPosition.test.js

684 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 details: 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 details: {
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