Files: ff7663e73e7aedeb75242d658e91bb048df0253f / test / poll / sync / isPoll.test.js
535 bytesRaw
1 | const test = require('tape') |
2 | const ChooseOne = require('../../../poll/sync/chooseOne') |
3 | const isPoll = require('../../../isPoll') |
4 | |
5 | // this is for testing the attributes that are required for all polls |
6 | |
7 | test('Poll - common requirements', function (t) { |
8 | var missingTitle = ChooseOne({ |
9 | choices: [1, 2, 'three'] |
10 | }) |
11 | t.false(isPoll(missingTitle), 'needs title') |
12 | |
13 | var missingDetails = { |
14 | type: 'poll', |
15 | pollDetails: undefined, |
16 | title: 'how many food' |
17 | } |
18 | t.false(isPoll(missingDetails), 'missing details') |
19 | |
20 | t.end() |
21 | }) |
22 |
Built with git-ssb-web