test: better idb migration test (#1080)
This commit is contained in:
parent
15198f19d6
commit
4257951f93
|
@ -162,7 +162,7 @@ describe('test-database.js', function () {
|
||||||
let allStatuses = times(40, createStatus)
|
let allStatuses = times(40, createStatus)
|
||||||
await dbApi.insertTimelineItems(INSTANCE_NAME, 'local', allStatuses)
|
await dbApi.insertTimelineItems(INSTANCE_NAME, 'local', allStatuses)
|
||||||
|
|
||||||
let statuses = await dbApi.getTimeline(INSTANCE_NAME, 'local', null, 40)
|
let statuses = await dbApi.getTimeline(INSTANCE_NAME, 'local', null, 1000)
|
||||||
let expected = allStatuses.slice().reverse()
|
let expected = allStatuses.slice().reverse()
|
||||||
assert.deepStrictEqual(statuses.map(stripDBFields), expected)
|
assert.deepStrictEqual(statuses.map(stripDBFields), expected)
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ describe('test-database.js', function () {
|
||||||
await getDatabase(INSTANCE_NAME)
|
await getDatabase(INSTANCE_NAME)
|
||||||
|
|
||||||
// check that the old statuses are correct
|
// check that the old statuses are correct
|
||||||
statuses = await dbApi.getTimeline(INSTANCE_NAME, 'local', null, 40)
|
statuses = await dbApi.getTimeline(INSTANCE_NAME, 'local', null, 1000)
|
||||||
expected = allStatuses.slice().reverse()
|
expected = allStatuses.slice().reverse()
|
||||||
assert.deepStrictEqual(statuses.map(stripDBFields), expected)
|
assert.deepStrictEqual(statuses.map(stripDBFields), expected)
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ describe('test-database.js', function () {
|
||||||
|
|
||||||
await dbApi.insertTimelineItems(INSTANCE_NAME, 'local', moreStatuses)
|
await dbApi.insertTimelineItems(INSTANCE_NAME, 'local', moreStatuses)
|
||||||
|
|
||||||
statuses = await dbApi.getTimeline(INSTANCE_NAME, 'local', null, 60)
|
statuses = await dbApi.getTimeline(INSTANCE_NAME, 'local', null, 1000)
|
||||||
expected = moreStatuses.slice().reverse().concat(allStatuses.reverse())
|
expected = moreStatuses.slice().reverse().concat(allStatuses.reverse())
|
||||||
|
|
||||||
assert.deepStrictEqual(statuses.map(stripDBFields), expected)
|
assert.deepStrictEqual(statuses.map(stripDBFields), expected)
|
||||||
|
|
Loading…
Reference in New Issue