@malloy-publisher/sdk 0.0.247 → 0.0.249

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.
Files changed (98) hide show
  1. package/README.md +32 -17
  2. package/dist/ServerProvider-CcfeBpt3.cjs.js +1 -0
  3. package/dist/{ServerProvider-BxEh3nFI.es.js → ServerProvider-EqBlMMqx.es.js} +1056 -905
  4. package/dist/client/api.d.ts +298 -7
  5. package/dist/client/index.cjs.js +1 -1
  6. package/dist/client/index.es.js +74 -70
  7. package/dist/components/Dashboard/Dashboard.d.ts +49 -0
  8. package/dist/components/Dashboard/DashboardTile.d.ts +48 -0
  9. package/dist/components/Dashboard/index.d.ts +2 -0
  10. package/dist/components/Notebook/Notebook.d.ts +46 -8
  11. package/dist/components/Notebook/NotebookCell.d.ts +37 -3
  12. package/dist/components/Notebook/runPlan.d.ts +29 -0
  13. package/dist/components/Notebook/types.d.ts +10 -0
  14. package/dist/components/Package/ContentTypeIcon.d.ts +17 -1
  15. package/dist/components/Package/Package.d.ts +1 -4
  16. package/dist/components/RenderedResult/RenderedResult.d.ts +7 -1
  17. package/dist/components/RenderedResult/ResultContainer.d.ts +3 -1
  18. package/dist/components/ResultsDialog.d.ts +4 -1
  19. package/dist/components/ServerProvider.d.ts +2 -1
  20. package/dist/components/click_helper.d.ts +10 -1
  21. package/dist/components/drill/index.d.ts +3 -0
  22. package/dist/components/drill/markDrillableCells.d.ts +55 -0
  23. package/dist/components/drill/resolveDrill.d.ts +159 -0
  24. package/dist/components/drill/useDrill.d.ts +63 -0
  25. package/dist/components/given/GivenInput.d.ts +27 -3
  26. package/dist/components/given/GivensPanel.d.ts +36 -7
  27. package/dist/components/given/filterValue.d.ts +117 -0
  28. package/dist/components/given/index.d.ts +1 -1
  29. package/dist/components/given/paramCodec.d.ts +60 -0
  30. package/dist/components/index.d.ts +4 -1
  31. package/dist/components/styles.d.ts +23 -0
  32. package/dist/constants/docLinks.d.ts +6 -0
  33. package/dist/{core-BuvlzSIX.es.js → core-DFBwNhvb.es.js} +1 -1
  34. package/dist/{core-C86Rb7tJ.cjs.js → core-DZk7z7ko.cjs.js} +1 -1
  35. package/dist/hooks/givenValue.d.ts +10 -0
  36. package/dist/hooks/index.d.ts +3 -1
  37. package/dist/hooks/useGivensState.d.ts +64 -0
  38. package/dist/hooks/useSuggestOptions.d.ts +78 -0
  39. package/dist/{index-BdtAZ5k6.es.js → index-CLcRrkxd.es.js} +41221 -39894
  40. package/dist/index-CWQXhe0D.cjs.js +338 -0
  41. package/dist/index.cjs.js +1 -1
  42. package/dist/index.es.js +77 -62
  43. package/dist/theme/types.d.ts +9 -0
  44. package/package.json +3 -1
  45. package/src/components/Connections/AddConnectionDialog.tsx +10 -1
  46. package/src/components/Dashboard/Dashboard.tsx +395 -0
  47. package/src/components/Dashboard/DashboardTile.tsx +150 -0
  48. package/src/components/Dashboard/index.ts +2 -0
  49. package/src/components/Home/Home.tsx +114 -23
  50. package/src/components/Notebook/Notebook.tsx +444 -390
  51. package/src/components/Notebook/NotebookCell.tsx +117 -3
  52. package/src/components/Notebook/runPlan.spec.ts +152 -0
  53. package/src/components/Notebook/runPlan.ts +64 -0
  54. package/src/components/Notebook/types.ts +11 -0
  55. package/src/components/Package/ContentTypeIcon.spec.ts +88 -0
  56. package/src/components/Package/ContentTypeIcon.tsx +77 -6
  57. package/src/components/Package/Package.tsx +148 -38
  58. package/src/components/RenderedResult/RenderedResult.tsx +309 -19
  59. package/src/components/RenderedResult/ResultContainer.tsx +28 -1
  60. package/src/components/ResultsDialog.tsx +5 -0
  61. package/src/components/ServerProvider.tsx +2 -0
  62. package/src/components/click_helper.ts +14 -1
  63. package/src/components/drill/index.ts +25 -0
  64. package/src/components/drill/markDrillableCells.dom.spec.ts +310 -0
  65. package/src/components/drill/markDrillableCells.spec.ts +106 -0
  66. package/src/components/drill/markDrillableCells.ts +311 -0
  67. package/src/components/drill/resolveDrill.spec.ts +446 -0
  68. package/src/components/drill/resolveDrill.ts +372 -0
  69. package/src/components/drill/useDrill.tsx +200 -0
  70. package/src/components/given/GivenInput.spec.tsx +495 -15
  71. package/src/components/given/GivenInput.tsx +562 -30
  72. package/src/components/given/GivensPanel.spec.tsx +172 -0
  73. package/src/components/given/GivensPanel.tsx +139 -32
  74. package/src/components/given/filterValue.spec.ts +361 -0
  75. package/src/components/given/filterValue.ts +204 -0
  76. package/src/components/given/index.ts +5 -1
  77. package/src/components/given/paramCodec.spec.ts +854 -0
  78. package/src/components/given/paramCodec.ts +480 -0
  79. package/src/components/index.ts +4 -1
  80. package/src/components/styles.ts +27 -3
  81. package/src/constants/docLinks.spec.ts +51 -0
  82. package/src/constants/docLinks.ts +26 -0
  83. package/src/hooks/givenValue.ts +10 -0
  84. package/src/hooks/index.ts +6 -4
  85. package/src/hooks/useGivensState.spec.ts +446 -0
  86. package/src/hooks/useGivensState.ts +337 -0
  87. package/src/hooks/useSuggestOptions.spec.ts +109 -0
  88. package/src/hooks/useSuggestOptions.ts +260 -0
  89. package/src/theme/buildTableCssVars.ts +4 -0
  90. package/src/theme/resolveTheme.spec.ts +13 -0
  91. package/src/theme/resolveTheme.ts +3 -0
  92. package/src/theme/types.ts +9 -0
  93. package/test/README.md +16 -10
  94. package/dist/ServerProvider-Dg5S1qBU.cjs.js +0 -1
  95. package/dist/hooks/useGivensForm.d.ts +0 -35
  96. package/dist/index-MES4MGpQ.cjs.js +0 -309
  97. package/src/hooks/useGivensForm.spec.ts +0 -99
  98. package/src/hooks/useGivensForm.ts +0 -107
@@ -0,0 +1,446 @@
1
+ import { act, renderHook } from "@testing-library/react";
2
+ import { describe, expect, it } from "bun:test";
3
+ import { useGivensState } from "./useGivensState";
4
+
5
+ const TYPES = new Map<string, string | undefined>([
6
+ ["REGION", "filter<string>"],
7
+ ["MIN_AMOUNT", "number"],
8
+ ]);
9
+
10
+ const entries = (values: Map<string, unknown>) => Object.fromEntries(values);
11
+
12
+ /**
13
+ * A host that behaves like `NotebookPage` and `DashboardPage`: it keeps the
14
+ * applied values in its URL and feeds that URL straight back in as `params`.
15
+ *
16
+ * Testing the hook without that loop misses most of what it does. Every Reset
17
+ * defect below is invisible to a test that treats `params` as a constant,
18
+ * because the second half of each one happens when the values the hook just
19
+ * reported arrive back through the front door.
20
+ */
21
+ function renderWithUrlHost(options: {
22
+ autorun: boolean;
23
+ startingValues?: Record<string, string>;
24
+ initialUrl?: Record<string, string>;
25
+ }) {
26
+ let url: Record<string, string> = options.initialUrl ?? {};
27
+ const urlWrites: Record<string, string>[] = [];
28
+ // Mounted with no starting values, then given them a render later. That is
29
+ // how it really happens: they arrive with the notebook, after the first
30
+ // render, and the hook's report guard is seeded for exactly that order.
31
+ // Handing them over at mount instead makes the first render look like the
32
+ // steady state and hides whether they ever reach the URL.
33
+ const arrival: { starting?: Record<string, string> } = {};
34
+ const view = renderHook(
35
+ ({
36
+ p,
37
+ s,
38
+ }: {
39
+ p: Record<string, string>;
40
+ s: Record<string, string> | undefined;
41
+ }) =>
42
+ useGivensState({
43
+ declaredTypes: TYPES,
44
+ startingValues: s,
45
+ params: p,
46
+ onParamsChange: (next) => {
47
+ url = next;
48
+ urlWrites.push(next);
49
+ },
50
+ autorun: options.autorun,
51
+ }),
52
+ { initialProps: { p: url, s: arrival.starting } },
53
+ );
54
+ // Let the reported values propagate back through the host, repeatedly, so a
55
+ // change that keeps provoking another URL write shows up as more writes
56
+ // rather than as a stable-looking end state.
57
+ const settle = () => {
58
+ for (let i = 0; i < 5; i++)
59
+ act(() => view.rerender({ p: url, s: arrival.starting }));
60
+ };
61
+ settle();
62
+ arrival.starting = options.startingValues;
63
+ settle();
64
+ return {
65
+ get current() {
66
+ return view.result.current;
67
+ },
68
+ settle,
69
+ urlWrites,
70
+ get url() {
71
+ return url;
72
+ },
73
+ };
74
+ }
75
+
76
+ describe("useGivensState: where the controls start", () => {
77
+ it("takes the document's starting values when the URL is empty", () => {
78
+ const host = renderWithUrlHost({
79
+ autorun: true,
80
+ startingValues: { REGION: "West" },
81
+ });
82
+ expect(entries(host.current.applied)).toEqual({ REGION: "West" });
83
+ });
84
+
85
+ it("lets the URL win, so a shared link shows what the sender saw", () => {
86
+ const host = renderWithUrlHost({
87
+ autorun: true,
88
+ startingValues: { REGION: "West" },
89
+ initialUrl: { REGION: "Northeast" },
90
+ });
91
+ expect(entries(host.current.applied)).toEqual({ REGION: "Northeast" });
92
+ });
93
+
94
+ it("reads each value as its declared type", () => {
95
+ const host = renderWithUrlHost({
96
+ autorun: true,
97
+ initialUrl: { REGION: "West", MIN_AMOUNT: "100" },
98
+ });
99
+ expect(host.current.applied.get("REGION")).toBe("West");
100
+ expect(host.current.applied.get("MIN_AMOUNT")).toBe(100);
101
+ });
102
+
103
+ it("ignores a parameter the model does not declare", () => {
104
+ // A tracking tag on the page URL must not reach a query, which would
105
+ // fail outright on an unknown given.
106
+ const host = renderWithUrlHost({
107
+ autorun: true,
108
+ initialUrl: { REGION: "West", utm_source: "slack" },
109
+ });
110
+ expect(entries(host.current.applied)).toEqual({ REGION: "West" });
111
+ });
112
+
113
+ it("reports the starting values outward once, and then stops", () => {
114
+ const host = renderWithUrlHost({
115
+ autorun: true,
116
+ startingValues: { REGION: "West" },
117
+ });
118
+ expect(host.urlWrites).toEqual([{ REGION: "West" }]);
119
+ });
120
+ });
121
+
122
+ describe("useGivensState: editing", () => {
123
+ it("applies immediately under autorun", () => {
124
+ const host = renderWithUrlHost({ autorun: true });
125
+ act(() => host.current.setGiven("REGION", "Northeast"));
126
+ host.settle();
127
+
128
+ expect(entries(host.current.applied)).toEqual({ REGION: "Northeast" });
129
+ expect(host.current.pending).toBe(false);
130
+ expect(host.url).toEqual({ REGION: "Northeast" });
131
+ });
132
+
133
+ it("batches behind Apply when autorun is off", () => {
134
+ const host = renderWithUrlHost({ autorun: false });
135
+ act(() => host.current.setGiven("REGION", "Northeast"));
136
+ act(() => host.current.setGiven("MIN_AMOUNT", 100));
137
+ host.settle();
138
+
139
+ expect(entries(host.current.draft)).toEqual({
140
+ REGION: "Northeast",
141
+ MIN_AMOUNT: 100,
142
+ });
143
+ expect(entries(host.current.applied)).toEqual({});
144
+ expect(host.current.pending).toBe(true);
145
+ // Two edits, and the URL has not moved: nothing has been run yet.
146
+ expect(host.urlWrites).toEqual([]);
147
+
148
+ act(() => host.current.apply());
149
+ host.settle();
150
+
151
+ expect(entries(host.current.applied)).toEqual({
152
+ REGION: "Northeast",
153
+ MIN_AMOUNT: 100,
154
+ });
155
+ expect(host.current.pending).toBe(false);
156
+ // One write for two edits, which is the whole point of batching.
157
+ expect(host.urlWrites).toEqual([
158
+ { REGION: "Northeast", MIN_AMOUNT: "100" },
159
+ ]);
160
+ });
161
+
162
+ it("keeps the other starting values when one control is edited", () => {
163
+ const host = renderWithUrlHost({
164
+ autorun: true,
165
+ startingValues: { REGION: "West", MIN_AMOUNT: "5" },
166
+ });
167
+ act(() => host.current.setGiven("REGION", "Northeast"));
168
+ host.settle();
169
+
170
+ expect(entries(host.current.applied)).toEqual({
171
+ REGION: "Northeast",
172
+ MIN_AMOUNT: 5,
173
+ });
174
+ });
175
+
176
+ it("drops an override on null, back to the model default", () => {
177
+ const host = renderWithUrlHost({
178
+ autorun: true,
179
+ initialUrl: { REGION: "West" },
180
+ });
181
+ act(() => host.current.setGiven("REGION", null));
182
+ host.settle();
183
+
184
+ expect(host.current.applied.has("REGION")).toBe(false);
185
+ expect(host.url).toEqual({});
186
+ });
187
+
188
+ it("drops values for givens the model no longer declares", () => {
189
+ // What a package reload can do while the page is open. Sending a given
190
+ // the model no longer declares fails the query outright.
191
+ let url: Record<string, string> = { REGION: "West", MIN_AMOUNT: "100" };
192
+ const { result, rerender } = renderHook(
193
+ ({ types }: { types: Map<string, string | undefined> }) =>
194
+ useGivensState({
195
+ declaredTypes: types,
196
+ params: url,
197
+ onParamsChange: (next) => {
198
+ url = next;
199
+ },
200
+ autorun: true,
201
+ }),
202
+ { initialProps: { types: TYPES } },
203
+ );
204
+ expect(result.current.applied.size).toBe(2);
205
+
206
+ const reloaded = new Map([["REGION", "filter<string>"]]);
207
+ act(() => rerender({ types: reloaded }));
208
+
209
+ expect(entries(result.current.applied)).toEqual({ REGION: "West" });
210
+ });
211
+ });
212
+
213
+ describe("useGivensState: Reset", () => {
214
+ // Two symptoms were reported against #935's `clearAll`, and they turned out
215
+ // to be one defect: it cleared to an EMPTY map rather than to the starting
216
+ // point, and it only committed under autorun. Each test below fails against
217
+ // that version, in the way named in its comment.
218
+
219
+ it("puts the document's starting values back, and runs once", () => {
220
+ // Was: cleared to empty, the empty state went out to the URL, the
221
+ // starting values then flowed back in from `initial`, and the queries
222
+ // ran a second time. Two URL writes where there should be one.
223
+ const host = renderWithUrlHost({
224
+ autorun: true,
225
+ startingValues: { REGION: "West" },
226
+ });
227
+ act(() => host.current.setGiven("REGION", "Northeast"));
228
+ host.settle();
229
+ const writesBefore = host.urlWrites.length;
230
+
231
+ act(() => host.current.reset());
232
+ host.settle();
233
+
234
+ expect(entries(host.current.applied)).toEqual({ REGION: "West" });
235
+ expect(host.url).toEqual({ REGION: "West" });
236
+ expect(host.urlWrites.length - writesBefore).toBe(1);
237
+ });
238
+
239
+ it("takes effect with autorun off, instead of doing nothing at all", () => {
240
+ // Was: `applied` was left untouched whenever autorun was false, so the
241
+ // URL never changed and no query re-ran. Reset was inert.
242
+ const host = renderWithUrlHost({ autorun: false });
243
+ act(() => host.current.setGiven("REGION", "Northeast"));
244
+ act(() => host.current.apply());
245
+ host.settle();
246
+ expect(host.url).toEqual({ REGION: "Northeast" });
247
+ const writesBefore = host.urlWrites.length;
248
+
249
+ act(() => host.current.reset());
250
+ host.settle();
251
+
252
+ expect(entries(host.current.applied)).toEqual({});
253
+ expect(host.url).toEqual({});
254
+ expect(host.urlWrites.length - writesBefore).toBe(1);
255
+ });
256
+
257
+ it("leaves nothing pending, so Apply does not light up after a Reset", () => {
258
+ const host = renderWithUrlHost({
259
+ autorun: false,
260
+ startingValues: { REGION: "West" },
261
+ });
262
+ act(() => host.current.setGiven("REGION", "Northeast"));
263
+ host.settle();
264
+ expect(host.current.pending).toBe(true);
265
+
266
+ act(() => host.current.reset());
267
+ host.settle();
268
+
269
+ expect(host.current.pending).toBe(false);
270
+ expect(entries(host.current.draft)).toEqual({ REGION: "West" });
271
+ });
272
+
273
+ it("clears a URL-carried value rather than treating it as the start", () => {
274
+ // The URL is the thing being reset away from, so a link's values are not
275
+ // the starting point even though they win on arrival.
276
+ const host = renderWithUrlHost({
277
+ autorun: true,
278
+ startingValues: { REGION: "West" },
279
+ initialUrl: { REGION: "Northeast" },
280
+ });
281
+ expect(entries(host.current.applied)).toEqual({ REGION: "Northeast" });
282
+
283
+ act(() => host.current.reset());
284
+ host.settle();
285
+
286
+ expect(entries(host.current.applied)).toEqual({ REGION: "West" });
287
+ });
288
+ });
289
+
290
+ describe("useGivensState: settling", () => {
291
+ it("stops reporting once the host echoes the values back", () => {
292
+ // The hook reports applied values out for the host to put in the URL,
293
+ // and the host feeds that URL back in. Without the `sameParams` guard
294
+ // that is a loop.
295
+ const host = renderWithUrlHost({
296
+ autorun: true,
297
+ initialUrl: { REGION: "West" },
298
+ });
299
+ host.settle();
300
+ host.settle();
301
+ expect(host.urlWrites).toEqual([]);
302
+ });
303
+
304
+ it("settles when its inputs are fresh objects on every render", () => {
305
+ // Carried over from `useGivensForm.spec.ts`, which this hook replaces.
306
+ // That hook infinite-looped on an unmemoized argument: its effect
307
+ // returned a fresh Map every run, which changed state identity, which
308
+ // re-rendered, until React gave up with "Maximum update depth exceeded"
309
+ // after 645k warnings. This is a published SDK export, so a consumer can
310
+ // reasonably pass an object literal.
311
+ let renders = 0;
312
+ const { result } = renderHook(() => {
313
+ renders++;
314
+ return useGivensState({
315
+ declaredTypes: new Map([["REGION", "filter<string>"]]),
316
+ startingValues: { REGION: "West" },
317
+ params: {},
318
+ onParamsChange: () => {},
319
+ autorun: true,
320
+ });
321
+ });
322
+
323
+ expect(entries(result.current.applied)).toEqual({ REGION: "West" });
324
+ expect(renders).toBeLessThan(5);
325
+ });
326
+ });
327
+
328
+ describe("useGivensState: swapping documents", () => {
329
+ it("drops the previous notebook's applied values on navigation", () => {
330
+ // Navigating between notebooks reuses this hook's component, and the
331
+ // edits used to be keyed by their starting VALUES alone. Two notebooks
332
+ // that both start empty produced the same key, so the first one's
333
+ // applied values stayed active and filtered the second, while
334
+ // `lastReported` (already equal to them) suppressed the report that
335
+ // would have shown them in the URL.
336
+ const reported: Record<string, string>[] = [];
337
+ const { result, rerender } = renderHook(
338
+ (props: { doc: string; params: Record<string, string> }) =>
339
+ useGivensState({
340
+ declaredTypes: new Map([["REGION", "string"]]),
341
+ params: props.params,
342
+ documentKey: props.doc,
343
+ onParamsChange: (next) => reported.push(next),
344
+ autorun: true,
345
+ }),
346
+ { initialProps: { doc: "a.malloynb", params: {} } },
347
+ );
348
+
349
+ act(() => result.current.setGiven("REGION", "West"));
350
+ expect(entries(result.current.applied)).toEqual({ REGION: "West" });
351
+
352
+ // The host writes it to the URL and feeds it straight back in.
353
+ rerender({ doc: "a.malloynb", params: { REGION: "West" } });
354
+ expect(entries(result.current.applied)).toEqual({ REGION: "West" });
355
+
356
+ rerender({ doc: "b.malloynb", params: {} });
357
+ expect(entries(result.current.applied)).toEqual({});
358
+ expect(reported.at(-1)).toEqual({});
359
+ });
360
+
361
+ it("keeps edits to the givens a model reload did not drop", () => {
362
+ // `prune` exists to drop values for givens that no longer exist while
363
+ // keeping the rest. It never got the chance: `initialKey` was built from
364
+ // `initial`, which is already filtered by `declaredTypes`, so removing
365
+ // one given re-keyed everything and discarded the reader's edits to the
366
+ // givens that survived. A declaration change is not a new starting point.
367
+ const { result, rerender } = renderHook(
368
+ (props: { types: Map<string, string> }) =>
369
+ useGivensState({
370
+ declaredTypes: props.types,
371
+ startingValues: { STATUS: "open" },
372
+ documentKey: "orders.malloynb",
373
+ autorun: true,
374
+ }),
375
+ {
376
+ initialProps: {
377
+ types: new Map([
378
+ ["REGION", "string"],
379
+ ["STATUS", "string"],
380
+ ]),
381
+ },
382
+ },
383
+ );
384
+
385
+ act(() => result.current.setGiven("REGION", "east"));
386
+ expect(entries(result.current.applied)).toEqual({
387
+ STATUS: "open",
388
+ REGION: "east",
389
+ });
390
+
391
+ // The model author removes STATUS and the package reloads.
392
+ rerender({ types: new Map([["REGION", "string"]]) });
393
+ expect(entries(result.current.applied)).toEqual({ REGION: "east" });
394
+ });
395
+
396
+ it("is not re-keyed by the ORDER a host lists its parameters in", () => {
397
+ // `URLSearchParams` iterates in the query string's own order, so a host
398
+ // rewriting `?A=1&B=2` as `?B=2&A=1` would otherwise look like a new
399
+ // starting point and throw the reader's edits away for nothing.
400
+ const { result, rerender } = renderHook(
401
+ (props: { params: Record<string, string> }) =>
402
+ useGivensState({
403
+ declaredTypes: new Map([
404
+ ["A", "string"],
405
+ ["B", "string"],
406
+ ]),
407
+ params: props.params,
408
+ documentKey: "orders.malloynb",
409
+ autorun: true,
410
+ }),
411
+ { initialProps: { params: { A: "1", B: "2" } } },
412
+ );
413
+
414
+ act(() => result.current.setGiven("A", "edited"));
415
+ rerender({ params: { B: "2", A: "1" } });
416
+ expect(entries(result.current.applied)).toEqual({ A: "edited", B: "2" });
417
+ });
418
+
419
+ it("does not resurrect an abandoned edit when the key returns", () => {
420
+ // The edits were only IGNORED on a key mismatch, never discarded, and the
421
+ // key space is small enough to revisit: notebook a -> b -> a from a clean
422
+ // link matched the abandoned edits again and re-applied a filter the URL
423
+ // did not carry, to a reader who had just opened it fresh. Browser Back
424
+ // and a drill pushing an earlier URL do the same.
425
+ const { result, rerender } = renderHook(
426
+ (props: { doc: string; params: Record<string, string> }) =>
427
+ useGivensState({
428
+ declaredTypes: new Map([["REGION", "string"]]),
429
+ params: props.params,
430
+ documentKey: props.doc,
431
+ autorun: true,
432
+ }),
433
+ { initialProps: { doc: "a.malloynb", params: {} } },
434
+ );
435
+
436
+ act(() => result.current.setGiven("REGION", "East"));
437
+ // The host echoes it into the URL, then the reader navigates away.
438
+ rerender({ doc: "a.malloynb", params: { REGION: "East" } });
439
+ rerender({ doc: "b.malloynb", params: {} });
440
+ expect(entries(result.current.applied)).toEqual({});
441
+
442
+ // Back to the first notebook from a link carrying no query string.
443
+ rerender({ doc: "a.malloynb", params: {} });
444
+ expect(entries(result.current.applied)).toEqual({});
445
+ });
446
+ });