@cosmicdrift/kumiko-renderer-web 0.215.7 → 0.216.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-renderer-web",
3
- "version": "0.215.7",
3
+ "version": "0.216.0",
4
4
  "description": "Web-platform bindings for @cosmicdrift/kumiko-renderer. HTML default-primitives, browser history-based navigation, EventSource-backed live events, and a one-call createKumikoApp that mounts the whole stack via react-dom.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -16,9 +16,9 @@
16
16
  "./styles.css": "./src/styles.css"
17
17
  },
18
18
  "dependencies": {
19
- "@cosmicdrift/kumiko-dispatcher-live": "0.215.7",
20
- "@cosmicdrift/kumiko-headless": "0.215.7",
21
- "@cosmicdrift/kumiko-renderer": "0.215.7",
19
+ "@cosmicdrift/kumiko-dispatcher-live": "0.216.0",
20
+ "@cosmicdrift/kumiko-headless": "0.216.0",
21
+ "@cosmicdrift/kumiko-renderer": "0.216.0",
22
22
  "@radix-ui/react-dialog": "^1.1.15",
23
23
  "@radix-ui/react-dropdown-menu": "^2.1.16",
24
24
  "@radix-ui/react-label": "^2.1.8",
@@ -64,7 +64,7 @@
64
64
  "@types/react-dom": "^19.2.3",
65
65
  "jsdom": "^29.1.1",
66
66
  "tailwindcss": "^4.3.0",
67
- "@cosmicdrift/kumiko-locale-de": "0.215.7"
67
+ "@cosmicdrift/kumiko-locale-de": "0.216.0"
68
68
  },
69
69
  "repository": {
70
70
  "type": "git",
@@ -6,7 +6,9 @@ function stubDispatcher(result: QueryResult<{ url?: string }>): Dispatcher {
6
6
  return { query: async () => result } as unknown as Dispatcher;
7
7
  }
8
8
 
9
- // Works in both bunfig (node) and bunfig.dom.toml (happy-dom) runs:
9
+ // Sole postWithDownload suite (unit + DOM). The former
10
+ // src/__tests__/download.test.tsx duplicate was removed — this helper
11
+ // already covers both bunfig (node) and bunfig.dom.toml (happy-dom):
10
12
  // - node env: install a minimal fake window for the duration of the test,
11
13
  // then remove it again so later suites are unaffected.
12
14
  // - dom env: patch only location.assign on the real window — swapping the
@@ -1,52 +0,0 @@
1
- import { describe, expect, spyOn, test } from "bun:test";
2
- import type { Dispatcher, DispatcherError } from "@cosmicdrift/kumiko-headless";
3
- import { postWithDownload } from "../lib/download";
4
-
5
- function dispatcherReturning(result: unknown): Dispatcher {
6
- return { query: async () => result } as unknown as Dispatcher; // @cast-boundary test-stub
7
- }
8
-
9
- describe("postWithDownload", () => {
10
- test("success: navigates to the returned signed URL, returns null", async () => {
11
- const assign = spyOn(window.location, "assign").mockImplementation(() => {});
12
- const url = "https://store.example/export.zip?sig=abc";
13
- const err = await postWithDownload(
14
- dispatcherReturning({ isSuccess: true, data: { url } }),
15
- "f:query:download-by-job",
16
- { jobId: "j1" },
17
- );
18
- expect(err).toBeNull();
19
- expect(assign).toHaveBeenCalledWith(url);
20
- assign.mockRestore();
21
- });
22
-
23
- test("query failure: returns the dispatcher error, no navigation", async () => {
24
- const assign = spyOn(window.location, "assign").mockImplementation(() => {});
25
- const error: DispatcherError = {
26
- code: "not_found",
27
- httpStatus: 404,
28
- i18nKey: "userDataRights.errors.download.notFound",
29
- message: "nope",
30
- };
31
- const err = await postWithDownload(
32
- dispatcherReturning({ isSuccess: false, error }),
33
- "f:query:download-by-job",
34
- { jobId: "j1" },
35
- );
36
- expect(err).toEqual(error);
37
- expect(assign).not.toHaveBeenCalled();
38
- assign.mockRestore();
39
- });
40
-
41
- test("success but no url: returns synthetic error, no navigation", async () => {
42
- const assign = spyOn(window.location, "assign").mockImplementation(() => {});
43
- const err = await postWithDownload(
44
- dispatcherReturning({ isSuccess: true, data: {} }),
45
- "f:query:download-by-job",
46
- { jobId: "j1" },
47
- );
48
- expect(err?.code).toBe("download_url_missing");
49
- expect(assign).not.toHaveBeenCalled();
50
- assign.mockRestore();
51
- });
52
- });