test: update graph-index operation constructors to the VerbEndpointInts signature
This commit is contained in:
parent
708978210a
commit
62a449d38b
1 changed files with 4 additions and 5 deletions
|
|
@ -55,7 +55,7 @@ describe('Graph index operations — generation threading', () => {
|
||||||
it('AddToGraphIndexOperation stamps addVerb (and its rollback removeVerb) at the resolved generation', async () => {
|
it('AddToGraphIndexOperation stamps addVerb (and its rollback removeVerb) at the resolved generation', async () => {
|
||||||
const { provider, calls } = makeSpyProvider()
|
const { provider, calls } = makeSpyProvider()
|
||||||
const verb = makeVerb('verb-1')
|
const verb = makeVerb('verb-1')
|
||||||
const op = new AddToGraphIndexOperation(provider, verb, 10n, 20n, () => 7n)
|
const op = new AddToGraphIndexOperation(provider, verb, { sourceInt: 10n, targetInt: 20n }, () => 7n)
|
||||||
|
|
||||||
const rollback = await op.execute()
|
const rollback = await op.execute()
|
||||||
expect(calls).toEqual([{ method: 'addVerb', generation: 7n, verbId: 'verb-1' }])
|
expect(calls).toEqual([{ method: 'addVerb', generation: 7n, verbId: 'verb-1' }])
|
||||||
|
|
@ -67,7 +67,7 @@ describe('Graph index operations — generation threading', () => {
|
||||||
it('RemoveFromGraphIndexOperation stamps removeVerb (and its rollback addVerb) at the resolved generation', async () => {
|
it('RemoveFromGraphIndexOperation stamps removeVerb (and its rollback addVerb) at the resolved generation', async () => {
|
||||||
const { provider, calls } = makeSpyProvider()
|
const { provider, calls } = makeSpyProvider()
|
||||||
const verb = makeVerb('verb-2')
|
const verb = makeVerb('verb-2')
|
||||||
const op = new RemoveFromGraphIndexOperation(provider, verb, 10n, 20n, () => 12n)
|
const op = new RemoveFromGraphIndexOperation(provider, verb, { sourceInt: 10n, targetInt: 20n }, () => 12n)
|
||||||
|
|
||||||
const rollback = await op.execute()
|
const rollback = await op.execute()
|
||||||
expect(calls).toEqual([{ method: 'removeVerb', generation: 12n, verbId: 'verb-2' }])
|
expect(calls).toEqual([{ method: 'removeVerb', generation: 12n, verbId: 'verb-2' }])
|
||||||
|
|
@ -83,7 +83,7 @@ describe('Graph index operations — generation threading', () => {
|
||||||
// at its execute-time value.
|
// at its execute-time value.
|
||||||
const { provider, calls } = makeSpyProvider()
|
const { provider, calls } = makeSpyProvider()
|
||||||
let current = 1n
|
let current = 1n
|
||||||
const op = new AddToGraphIndexOperation(provider, makeVerb('verb-3'), 10n, 20n, () => current)
|
const op = new AddToGraphIndexOperation(provider, makeVerb('verb-3'), { sourceInt: 10n, targetInt: 20n }, () => current)
|
||||||
|
|
||||||
current = 42n // store assigns the batch generation after the op is built
|
current = 42n // store assigns the batch generation after the op is built
|
||||||
await op.execute()
|
await op.execute()
|
||||||
|
|
@ -97,8 +97,7 @@ describe('Graph index operations — generation threading', () => {
|
||||||
const op = new AddToGraphIndexOperation(
|
const op = new AddToGraphIndexOperation(
|
||||||
provider,
|
provider,
|
||||||
makeVerb('verb-4'),
|
makeVerb('verb-4'),
|
||||||
10n,
|
{ sourceInt: 10n, targetInt: 20n },
|
||||||
20n,
|
|
||||||
() => 5n,
|
() => 5n,
|
||||||
(verbInt) => {
|
(verbInt) => {
|
||||||
seen = verbInt
|
seen = verbInt
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue