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