@rotorsoft/act-tck 1.27.8 → 1.27.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1218,6 +1218,46 @@ var runStoreTck = (options) => {
1218
1218
  });
1219
1219
  expect8(full).toHaveLength(2);
1220
1220
  });
1221
+ it7("with_snaps applies the resume floor on a backward scan too", async () => {
1222
+ const s = `q-snap-back-${uid()}`;
1223
+ await store.commit(
1224
+ s,
1225
+ [inc(1), inc(1)],
1226
+ make_meta({ stream: s })
1227
+ );
1228
+ const [snap] = await store.commit(
1229
+ s,
1230
+ [{ name: SNAP_EVENT2, data: { count: 2 } }],
1231
+ make_meta({ stream: s })
1232
+ );
1233
+ await store.commit(
1234
+ s,
1235
+ [inc(1), inc(1), inc(1)],
1236
+ make_meta({ stream: s })
1237
+ );
1238
+ const backward = await collect(store, {
1239
+ stream: s,
1240
+ stream_exact: true,
1241
+ with_snaps: true,
1242
+ backward: true
1243
+ });
1244
+ expect8(backward).toHaveLength(4);
1245
+ expect8(backward[backward.length - 1].name).toBe(SNAP_EVENT2);
1246
+ expect8(backward.every((e) => e.id >= snap.id)).toBe(true);
1247
+ const s2 = `q-nosnap-back-${uid()}`;
1248
+ await store.commit(
1249
+ s2,
1250
+ [inc(1), inc(1)],
1251
+ make_meta({ stream: s2 })
1252
+ );
1253
+ const full = await collect(store, {
1254
+ stream: s2,
1255
+ stream_exact: true,
1256
+ with_snaps: true,
1257
+ backward: true
1258
+ });
1259
+ expect8(full).toHaveLength(2);
1260
+ });
1221
1261
  it7("supports backward traversal", async () => {
1222
1262
  const s = `q-back-${uid()}`;
1223
1263
  const committed = await store.commit(
@@ -4003,48 +4043,6 @@ var runStoreTck = (options) => {
4003
4043
  );
4004
4044
  expect8(bwd).toEqual([10]);
4005
4045
  });
4006
- it7("time-travel query ignores a snapshot newer than the created cutoff", async () => {
4007
- const s = `restore-tt-snap-${uid()}`;
4008
- const t0 = /* @__PURE__ */ new Date("2020-01-01T00:00:00.000Z");
4009
- const t1 = /* @__PURE__ */ new Date("2020-02-01T00:00:00.000Z");
4010
- const tSnap = /* @__PURE__ */ new Date("2020-03-01T00:00:00.000Z");
4011
- await restore(
4012
- as_source([
4013
- event(1, s, 0, "Incremented", t0, { amount: 1 }),
4014
- event(2, s, 1, "Incremented", t1, { amount: 2 }),
4015
- // Snapshot committed last → highest id and latest `created`.
4016
- event(3, s, 2, SNAP_EVENT2, tSnap, { count: 3 })
4017
- ])
4018
- );
4019
- const cutoff = /* @__PURE__ */ new Date("2020-01-15T00:00:00.000Z");
4020
- const before = [];
4021
- await store.query(
4022
- (e) => {
4023
- before.push(e.data.amount);
4024
- },
4025
- {
4026
- stream: s,
4027
- stream_exact: true,
4028
- with_snaps: true,
4029
- created_before: cutoff
4030
- }
4031
- );
4032
- expect8(before).toEqual([1]);
4033
- const after = [];
4034
- await store.query(
4035
- (e) => {
4036
- if (e.name !== SNAP_EVENT2)
4037
- after.push(e.data.amount);
4038
- },
4039
- {
4040
- stream: s,
4041
- stream_exact: true,
4042
- with_snaps: true,
4043
- created_after: cutoff
4044
- }
4045
- );
4046
- expect8(after).toEqual([2]);
4047
- });
4048
4046
  it7.skipIf(!caps.pii_isolation)(
4049
4047
  "isolates restored pii so forget_pii erases it",
4050
4048
  async () => {