Commit 94589ffe4b48f63a75b21a0142f48465fd3e0a18
add test to check positive case for fully featured poll message (should probably extract)
mix irving committed on 3/5/2018, 5:48:10 AMParent: 1c7838db4a112873f77b9c4e8962ac23b04bbbf7
Files changed
test/poll/sync/isPoll.test.js | changed |
test/poll/sync/isPoll.test.js | ||
---|---|---|
@@ -25,6 +25,29 @@ | ||
25 | 25 | } |
26 | 26 | t.false(isPoll(missingDetails), 'needs details') |
27 | 27 | t.true(isPoll.errors, 'failing validations have errors') |
28 | 28 | |
29 | + var fullyFeatured = { | |
30 | + type: 'poll', | |
31 | + pollDetails: { | |
32 | + type: 'chooseOnePoll', // TODO change to chooseOne? | |
33 | + title: 'how many dogs?', | |
34 | + choices: [1, 2, 3] | |
35 | + }, | |
36 | + title: 'how many food', | |
37 | + body: 'this is really important, please let me know', | |
38 | + mentions: [ | |
39 | + {name: 'mix', link: '@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519'}, | |
40 | + {name: 'sweet drawing', link: '&mwILr7kd1Tug/4vX5nW6YORhyununwkO4cF6jbiSyoA=.sha256'}, | |
41 | + {link: '%s8uVi560mwpE8ncjT+eMz5XBQBREdk4exvM3D6dIg9g=.sha256'} | |
42 | + ], | |
43 | + recps: [ | |
44 | + '@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519', | |
45 | + {name: 'mix', link: '@ye+QM09iPcDJD6YvQYjoQc7sLF/IFhmNbEqgdzQo3lQ=.ed25519'} | |
46 | + ], | |
47 | + closesAt: Date.now() | |
48 | + } | |
49 | + t.true(isPoll(fullyFeatured), 'fully featured') | |
50 | + if (isPoll.errors) console.log(isPoll.errors) | |
51 | + | |
29 | 52 | t.end() |
30 | 53 | }) |
Built with git-ssb-web