feat!: useShapeQuery prend le Scope du SDK, et un store se nomme par sa reference
This commit is contained in:
@@ -40,12 +40,13 @@ import {
|
||||
resetStoreRegistry,
|
||||
getCaps,
|
||||
} from "../src/shared-wallet/bootstrap";
|
||||
import { resetRegistryCache } from "../src/shared-wallet/account-registry";
|
||||
import { listMyEntityDocs, resetRegistryCache } from "../src/shared-wallet/account-registry";
|
||||
import type { RegistrySession } from "../src/shared-wallet/account-registry";
|
||||
import { resetOpenedRepos } from "../src/emulated-verifier/open-repo";
|
||||
import { resetPublicStoreFetches } from "../src/emulated-verifier/public-store";
|
||||
import { connectedUser } from "../src/emulated-verifier/connect";
|
||||
import type { NgLike, Nuri, Scope, UseShapeLike } from "../src/model/types";
|
||||
import { storeOfType } from "./wallet-fake";
|
||||
import type { NgLike, Nuri, StoreType, UseShapeLike } from "../src/model/types";
|
||||
|
||||
const SESSION: RegistrySession = { sessionId: "sid-reload", privateStoreId: "PRIV-RELOAD" };
|
||||
|
||||
@@ -55,7 +56,7 @@ const RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
|
||||
/** The application's own predicate — the note's title, in the document it created. */
|
||||
const TITLE = "urn:test:title";
|
||||
|
||||
const ALL_SCOPES: Scope[] = ["public", "protected", "private"];
|
||||
const ALL_SCOPES: StoreType[] = ["public", "protected", "private"];
|
||||
|
||||
// --- the fake broker -------------------------------------------------------
|
||||
|
||||
@@ -303,10 +304,10 @@ async function signIn(id: string): Promise<void> {
|
||||
}
|
||||
|
||||
/** The first visit: sign in, create the note, write its title into it. */
|
||||
async function firstVisit(quads: Quad[], scope: Scope): Promise<Nuri> {
|
||||
async function firstVisit(quads: Quad[], scope: StoreType): Promise<Nuri> {
|
||||
boot(quads);
|
||||
await signIn("alice");
|
||||
const note = await storeRegistry.createEntityDoc(scope);
|
||||
const note = await storeRegistry.createEntityDoc(await storeOfType(scope));
|
||||
await docs.sparqlUpdate(
|
||||
SESSION.sessionId,
|
||||
`INSERT DATA { <${note}> <${TITLE}> "the note" }`,
|
||||
@@ -349,7 +350,7 @@ describe("after a reload, the creator comes back to its own document", () => {
|
||||
reload(quads);
|
||||
await signIn("alice");
|
||||
|
||||
expect(await storeRegistry.listMyEntityDocs(scope)).toContain(note);
|
||||
expect(await listMyEntityDocs("alice", scope)).toContain(note);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user