Files: 81f8f8f4fc3b67a1fc26efcfeebed05d1ed7c223 / test / position / sync / chooseOne.test.js
689 bytesRaw
1 | const test = require('tape') |
2 | const ChooseOne = require('../../../position/sync/chooseOne') |
3 | const isPosition = require('../../../isPosition') |
4 | |
5 | test('Position - ChooseOne', function (t) { |
6 | var invalidPosition = ChooseOne({ |
7 | }) |
8 | t.false(isPosition(invalidPosition), 'missing a choice') |
9 | |
10 | var validPosition = ChooseOne({ |
11 | choice: 0 |
12 | }) |
13 | t.true(isPosition(validPosition), 'simple') |
14 | |
15 | var fullPositionMsg = { |
16 | key: '%somekey', |
17 | value: { |
18 | content: validPosition |
19 | } |
20 | } |
21 | t.true(isPosition(fullPositionMsg), 'simple (full msg)') |
22 | // NOTE - we might want an isChooseOnePosition in future |
23 | // t.true(isChooseOnePosition(fullPositionMsg), 'simple (full msg)') |
24 | |
25 | t.end() |
26 | }) |
27 |
Built with git-ssb-web