feat!: useShapeQuery prend le Scope du SDK, et un store se nomme par sa reference
This commit is contained in:
@@ -33,6 +33,7 @@ import { test, expect, describe, afterAll, beforeEach } from "bun:test";
|
||||
import { docs, inbox as inboxSurface, storeRegistry } from "../src/index";
|
||||
import { getCaps } from "../src/shared-wallet/bootstrap";
|
||||
import { runScheduledInboxProcessingNow } from "../src/emulated-verifier/inbox-processor";
|
||||
import { listMyEntityDocs } from "../src/shared-wallet/account-registry";
|
||||
import { bootPage, forgetEverything, reloadPage, signIn, SESSION, type Quad } from "./wallet-fake";
|
||||
import type { Nuri } from "../src/model/types";
|
||||
|
||||
@@ -49,7 +50,7 @@ const MESSAGE = "j'apporte le café";
|
||||
async function aNoteOpenForMessages(quads: Quad[]): Promise<Nuri> {
|
||||
bootPage(quads);
|
||||
await signIn("alice");
|
||||
const note = await storeRegistry.createEntityDoc("public");
|
||||
const note = await storeRegistry.createEntityDoc(await storeRegistry.publicStore());
|
||||
await docs.sparqlUpdate(
|
||||
SESSION.sessionId,
|
||||
`INSERT DATA { <${note}> <${TITLE}> "Courses" }`,
|
||||
@@ -74,9 +75,14 @@ function inboxOnTheNote(quads: Quad[], note: Nuri): Nuri {
|
||||
return record.o.split(" ")[1] as Nuri;
|
||||
}
|
||||
|
||||
/** Alice's note, found the way her application finds it: by listing her own store. */
|
||||
/** Alice's note, found by listing her own store.
|
||||
*
|
||||
* That listing is the LIBRARY's own path now, not an application's: `listMyEntityDocs`
|
||||
* stopped being published in `1.0.0-dev.5` (no counterpart at any level upstream), so
|
||||
* this reaches it where it lives. What is under test is unchanged - the cold store still
|
||||
* has to answer, and it still has to refile the caps while it does. */
|
||||
async function myNote(): Promise<Nuri> {
|
||||
const mine = await storeRegistry.listMyEntityDocs("public");
|
||||
const mine = await listMyEntityDocs("alice", "public");
|
||||
const note = mine[0];
|
||||
if (!note) throw new Error("the note Alice wrote is not in her store");
|
||||
return note;
|
||||
|
||||
Reference in New Issue
Block a user