git ssb

0+

Piet / ssb-loomio



Commit f7844852666d755f5ea74290b4b3cc5bed2340a7

Use nDaysTime helper.

Piet Geursen committed on 5/10/2018, 10:10:03 PM
Parent: 34520bc583f5508541b906f83cc6473ee08991e3

Files changed

test/poll/async/get.test.jschanged
test/poll/async/get.test.jsView
@@ -17,16 +17,11 @@
1717 choices: ['prairie dog', 'kea', 'hermit crab'],
1818 closesAt: nDaysTime(2)
1919 })
2020
21-const date = new Date()
21+const agesAway = nDaysTime(100)
22+const soSoon = nDaysTime(1)
2223
23-date.setYear(1989)
24-const agesAgo = date.toISOString()
25-
26-date.setYear(2020)
27-const soSoon = date.toISOString()
28-
2924 test('pull.async.get', t => {
3025 piet.publish(pollContent, (err, poll) => {
3126 if (err) throw err
3227
@@ -44,9 +39,9 @@
4439 })
4540 }),
4641 pull.asyncMap((t, cb) => t.author.publish(t.position, cb)),
4742 pull.asyncMap((m, cb) => UpdatedClosingTime(server)({poll, closesAt: soSoon}, cb)),
48- pull.asyncMap((m, cb) => UpdatedClosingTime(server)({poll, closesAt: agesAgo}, cb)),
43+ pull.asyncMap((m, cb) => UpdatedClosingTime(server)({poll, closesAt: agesAway}, cb)),
4944 pull.asyncMap((t, cb) => piet.publish(t, cb)),
5045 pull.drain(
5146 m => {}, // console.log(m.value.content.type),
5247 onDone
@@ -65,9 +60,9 @@
6560 t.equal(data.title, poll.value.content.title, 'has title')
6661
6762 t.equal(data.positions.length, 2, 'has positions')
6863
69- t.equal(data.closesAt, agesAgo, 'gets the most recently published updated closing time')
64+ t.equal(data.closesAt, agesAway, 'gets the most recently published updated closing time')
7065
7166 const positions = data.positions
7267 t.deepEqual(positions[0].value.content.branch, [], 'first published position has no branch')
7368 t.deepEqual(positions[1].value.content.branch, [positions[0].key], 'second published branch has first position as branch')

Built with git-ssb-web