@saasicat/persistence-testing 1.0.0-rc.5 → 1.0.0-rc.6

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/.build-stamp CHANGED
@@ -1 +1 @@
1
- d04be94a0ccce0ece8dd5ee39e39bb9e8e17ace88ec0930b9699b83b9902b3ff
1
+ ebc7b4a96e9a57e93d8e7e38f708e2c44f7953784e74366e0391473dd2908f3f
package/dist/index.cjs CHANGED
@@ -149,13 +149,19 @@ function persistenceAdapterContract(options) {
149
149
  plan: "STARTER",
150
150
  planVersionId: oldVersion.planVersionId
151
151
  });
152
- await adapter.tenantSubscriptionWrite.changePlanImmediate("tenant-plan-change", {
153
- planId: "PRO",
154
- cycle: "YEARLY",
155
- periodStart: null,
156
- periodEnd: null,
157
- nextStatus: null
158
- });
152
+ const change = await adapter.tenantSubscriptionWrite.changePlanImmediate(
153
+ "tenant-plan-change",
154
+ {
155
+ planId: "PRO",
156
+ cycle: "YEARLY",
157
+ periodStart: null,
158
+ periodEnd: null,
159
+ nextStatus: null,
160
+ // The row has no cancellation, so this claims it.
161
+ expectedCanceledAt: null
162
+ }
163
+ );
164
+ import_strict.default.equal(change.claimed, true, "the plan write did not claim the row");
159
165
  const changed = await adapter.subscriptionRepository.findByTenantId("tenant-plan-change");
160
166
  import_strict.default.ok(changed, "changed subscription expected");
161
167
  import_strict.default.equal(changed.plan, "PRO");
@@ -206,7 +212,8 @@ function persistenceAdapterContract(options) {
206
212
  cycle: "MONTHLY",
207
213
  periodStart: null,
208
214
  periodEnd: null,
209
- nextStatus: null
215
+ nextStatus: null,
216
+ expectedCanceledAt: null
210
217
  },
211
218
  async (tx, callbackSubscriptionId) => {
212
219
  import_strict.default.equal(callbackSubscriptionId, subscriptionId);
package/dist/index.js CHANGED
@@ -113,13 +113,19 @@ function persistenceAdapterContract(options) {
113
113
  plan: "STARTER",
114
114
  planVersionId: oldVersion.planVersionId
115
115
  });
116
- await adapter.tenantSubscriptionWrite.changePlanImmediate("tenant-plan-change", {
117
- planId: "PRO",
118
- cycle: "YEARLY",
119
- periodStart: null,
120
- periodEnd: null,
121
- nextStatus: null
122
- });
116
+ const change = await adapter.tenantSubscriptionWrite.changePlanImmediate(
117
+ "tenant-plan-change",
118
+ {
119
+ planId: "PRO",
120
+ cycle: "YEARLY",
121
+ periodStart: null,
122
+ periodEnd: null,
123
+ nextStatus: null,
124
+ // The row has no cancellation, so this claims it.
125
+ expectedCanceledAt: null
126
+ }
127
+ );
128
+ assert.equal(change.claimed, true, "the plan write did not claim the row");
123
129
  const changed = await adapter.subscriptionRepository.findByTenantId("tenant-plan-change");
124
130
  assert.ok(changed, "changed subscription expected");
125
131
  assert.equal(changed.plan, "PRO");
@@ -170,7 +176,8 @@ function persistenceAdapterContract(options) {
170
176
  cycle: "MONTHLY",
171
177
  periodStart: null,
172
178
  periodEnd: null,
173
- nextStatus: null
179
+ nextStatus: null,
180
+ expectedCanceledAt: null
174
181
  },
175
182
  async (tx, callbackSubscriptionId) => {
176
183
  assert.equal(callbackSubscriptionId, subscriptionId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasicat/persistence-testing",
3
- "version": "1.0.0-rc.5",
3
+ "version": "1.0.0-rc.6",
4
4
  "description": "Contract test kit for SaaSiCat persistence adapters: one node:test suite that every adapter (Prisma, Drizzle, ...) must pass against a real database — locks, transaction rollback, atomic promo claims, tenant isolation, audit/MFA roundtrips.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -23,7 +23,7 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "@saasicat/core": "^1.0.0-rc.5"
26
+ "@saasicat/core": "^1.0.0-rc.6"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^25.6.0",