Fix tests

This commit is contained in:
Hongbo Wu 2022-10-28 18:01:56 +08:00
parent e87b81c5c8
commit 324e0191d6

View file

@ -132,23 +132,16 @@ describe('Integrations routers', () => {
refresh: true,
}
// create highlight
const location = 109
const patch = `@@ -${location + 1},16 +${location + 1},36 @@
. We're
+%3Comnivore_highlight%3E
humbled
@@ -254,16 +254,37 @@
h in the
+%3C/omnivore_highlight%3E
coming`
const highlightPositionPercent = 25
highlight = {
createdAt: new Date(),
id: 'test id',
patch,
patch: 'test patch',
quote: 'test quote',
shortId: 'test shortId',
updatedAt: new Date(),
userId: user.id,
highlightPositionPercent,
}
await addHighlightToPage(page.id, highlight, ctx)
// create highlights data for integration request
@ -162,8 +155,8 @@ describe('Integrations routers', () => {
highlighted_at: highlight.createdAt.toISOString(),
category: 'articles',
image_url: page.image,
location,
location_type: 'page',
location: highlightPositionPercent,
location_type: 'order',
note: highlight.annotation,
source_type: 'omnivore',
source_url: page.url,