fix: ng-helpers rejoint la surface dev.6, et son faux suit le contrat
This commit is contained in:
@@ -146,6 +146,21 @@ test("creating an index writes its field declaration, and nothing else", async (
|
||||
expect(world.contentsOf(ordinary)).toEqual([]);
|
||||
});
|
||||
|
||||
test("an index is recorded in its creator's PUBLIC store, named by that store's reference", async () => {
|
||||
const index = await as("alice", async (alice) => indexingOn(alice).create(FIELD));
|
||||
|
||||
// WHERE it landed, read off the fake rather than inferred from the call: an index a
|
||||
// stranger cannot open is not an index, and the private store is one keystroke away
|
||||
// (omitting the argument places it there).
|
||||
expect(world.storeOf(index)).toBe(world.storesOf("alice").public);
|
||||
|
||||
// And HOW the store was named: the reference the accessor handed back, not a word.
|
||||
// A store is told apart from every other reference only by being one of the three,
|
||||
// so the accessor is the only thing that can produce it.
|
||||
const placed = world.calls.filter((call) => call.entry === "storeRegistry.createEntityDoc").at(-1);
|
||||
expect(placed?.args).toEqual([world.storesOf("alice").public]);
|
||||
});
|
||||
|
||||
test("the write is the polyfill's canonical anchored form: the document named once, as the anchor", async () => {
|
||||
const index = await as("alice", async (alice) => indexingOn(alice).create(FIELD));
|
||||
const writes = world.calls.filter((call) => call.entry === "docs.sparqlUpdate");
|
||||
|
||||
Reference in New Issue
Block a user