Files: be17b27d1ff6966e3d7d922f5e612f4d2477dce4 / test / position / sync / isPosition.test.js
700 bytesRaw
1 | const test = require('tape') |
2 | const isPosition = require('../../../isPosition') |
3 | const { CHOOSE_ONE } = require('../../../types') |
4 | |
5 | // this is for testing the attributes that are required for all polls |
6 | test('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