create-disposabl-app 0.20.9 → 0.20.11

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/disposabl.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // ../cli/auth.ts
4
4
  import { lock } from "proper-lockfile";
5
5
  // ../cli/package.json
6
- var version = "0.20.9";
6
+ var version = "0.20.11";
7
7
  var package_default = {
8
8
  name: "@disposabl/cli",
9
9
  version,
package/dist/index.js CHANGED
@@ -1563,7 +1563,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
1563
1563
  import { Command, CommanderError } from "commander";
1564
1564
  import * as p2 from "@clack/prompts";
1565
1565
  // package.json
1566
- var version = "0.20.9";
1566
+ var version = "0.20.11";
1567
1567
 
1568
1568
  // ../cli/telemetry.ts
1569
1569
  var import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
@@ -1,8 +1,11 @@
1
+ process.env.EXPO_PUBLIC_REVENUECAT_IOS_APP_ID = "fixture-app";
2
+ process.env.EXPO_PUBLIC_REVENUECAT_IOS_TOPUP_PRODUCT = "coins";
1
3
  import { afterEach, expect, mock, test } from "bun:test";
2
4
  import { createElement } from "react";
3
5
  import { act, create } from "react-test-renderer";
4
6
  globalThis.IS_REACT_ACT_ENVIRONMENT = true;
5
7
  const listeners = new Set();
8
+ let topupReady = false;
6
9
  let starts = 0,
7
10
  stops = 0,
8
11
  country = "USA",
@@ -75,8 +78,8 @@ mock.module("../../../packages/disposabl-kit/mobile/billing/paywall", () => ({
75
78
  selectMonthlyOffering: () => ({}),
76
79
  }));
77
80
  mock.module("../../../packages/disposabl-kit/mobile/billing/topup", () => ({
78
- matchingTopupRoute: () => false,
79
- loadTopup: async () => null,
81
+ matchingTopupRoute: () => topupReady,
82
+ loadTopup: async () => (topupReady ? { identifier: "coins" } : null),
80
83
  }));
81
84
  const { useWebCheckout } =
82
85
  await import("../../../packages/disposabl-kit/mobile/billing/web-checkout");
@@ -104,6 +107,7 @@ async function change() {
104
107
  }
105
108
  afterEach(async () => {
106
109
  await act(async () => renderer?.unmount());
110
+ topupReady = false;
107
111
  starts = 0;
108
112
  stops = 0;
109
113
  country = "USA";
@@ -239,3 +243,35 @@ test("a queued callback from a removed subscription is ignored", async () => {
239
243
  queued();
240
244
  expect(changed).not.toHaveBeenCalled();
241
245
  });
246
+
247
+ test("US top-up uses its own handoff purchase selection", async () => {
248
+ topupReady = true;
249
+ await mount();
250
+ expect(result.topupAvailable).toBe(true);
251
+ let opened;
252
+ await act(async () => {
253
+ opened = await result.open("topup");
254
+ });
255
+ expect(opened).toBe(true);
256
+ expect(handoff).toHaveBeenCalledWith({ purchase: "topup" });
257
+ expect(openURL).toHaveBeenCalledWith(link.url);
258
+ expect(result.busy).toBe(false);
259
+ });
260
+
261
+ test("top-up rejects an unannounced non-US storefront before browser open", async () => {
262
+ topupReady = true;
263
+ await mount();
264
+ handoff.mockImplementationOnce(async () => {
265
+ country = "CAN";
266
+ return link;
267
+ });
268
+ let opened;
269
+ await act(async () => {
270
+ opened = await result.open("topup");
271
+ });
272
+ expect(handoff).toHaveBeenCalledTimes(1);
273
+ expect(opened).toBe(false);
274
+ expect(openURL).not.toHaveBeenCalled();
275
+ expect(result.topupAvailable).toBe(false);
276
+ expect(result.busy).toBe(false);
277
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-disposabl-app",
3
- "version": "0.20.9",
3
+ "version": "0.20.11",
4
4
  "description": "Create a Disposabl app",
5
5
  "type": "module",
6
6
  "license": "MIT",