Stream reader results and navigate with cursors [skip ci]
This commit is contained in:
@@ -5,14 +5,14 @@ const origin = "https://core.example.test/projects/thesisly/research/";
|
||||
|
||||
test("paper transport uses the anonymous no-store API without forwarding site credentials", async () => {
|
||||
const transport = createPaperTransport(origin, async (url, options) => {
|
||||
assert.equal(url.href, origin + "papers?q=graph&page=2");
|
||||
assert.equal(url.href, origin + "papers?q=graph&cursor=opaque");
|
||||
assert.equal(options.cache, "no-store");
|
||||
assert.equal(options.redirect, "error");
|
||||
assert.equal(options.headers, undefined);
|
||||
assert.ok(options.signal instanceof AbortSignal);
|
||||
return Response.json({ items: [], total: 0, topics: [], page: 2, pageSize: 8 });
|
||||
return Response.json({ items: [], nextCursor: "", previousCursor: "", topics: [], pageSize: 8 });
|
||||
});
|
||||
assert.deepEqual(await transport("papers?q=graph&page=2"), { ok: true, data: { items: [], total: 0, topics: [], page: 2, pageSize: 8 } });
|
||||
assert.deepEqual(await transport("papers?q=graph&cursor=opaque"), { ok: true, data: { items: [], nextCursor: "", previousCursor: "", topics: [], pageSize: 8 } });
|
||||
});
|
||||
|
||||
test("HTTP errors stay distinguishable and never become empty search results", async () => {
|
||||
|
||||
Reference in New Issue
Block a user