@zsailer/jupyter-server-side-documents-conformance 0.0.0-stage → 0.0.3

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.
@@ -0,0 +1,356 @@
1
+ // GENERATED by compliance/generate.py from the storyboards. Do not edit: change the storyboard, or oracle.yaml, and generate again.
2
+ import { test } from '@jupyterlab/galata';
3
+ import { E, story } from '../../runtime/story';
4
+
5
+ // Two tabs have the notebook open. The second loses its connection and the user types into c1. Meanwhile the first tab moves c1 to the end. Then the second tab reconnects.
6
+ test(
7
+ ...story(
8
+ {
9
+ "id": "Z1",
10
+ "group": "residual",
11
+ "title": "One person moves a cell while another types into it",
12
+ "requires": [],
13
+ "needsAlignment": true
14
+ },
15
+ async s => {
16
+ await s.notebook(["c0", "c1", "c2"]);
17
+ const tab = s.tab("tab");
18
+ const tab2 = s.tab("tab2");
19
+
20
+ await s.step(1, "First tab", "opens the notebook", async () => {
21
+ await tab.open();
22
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
23
+ });
24
+ await s.step(2, "Second tab", "opens the same notebook", async () => {
25
+ await tab2.open();
26
+ await s.expectTab(tab2, ["c0", "c1", "c2"]);
27
+ });
28
+ await s.step(3, "Second tab", "loses its connection", async () => {
29
+ await tab2.goOffline();
30
+ });
31
+ await s.step(4, "Second tab", "types “+B-TYPED” at the end of c1", async () => {
32
+ await tab2.type(1, " +B-TYPED");
33
+ await s.expectTab(tab2, ["c0", "c1 +B-TYPED", "c2"]);
34
+ });
35
+ await s.step(5, "First tab", "meanwhile moves c1 to the end of the notebook", async () => {
36
+ await tab.moveCell(1, 2);
37
+ await s.settle(tab);
38
+ await s.expectTab(tab, ["c0", "c2", "c1"]);
39
+ });
40
+ await s.step(6, "Second tab", "reconnects and shares its typing", async () => {
41
+ await tab2.goOnline();
42
+ });
43
+ await s.step(7, "Server", "merges the move and the typing", async () => {
44
+ // nothing for a test to do: the storyboard states what is so
45
+ });
46
+ await s.step(8, "File on disk", "autosave", async () => {
47
+ // nothing for a test to do: the storyboard states what is so
48
+ });
49
+
50
+ await s.ends([
51
+ { label: "The move and the typing both survive", ends: { tab: ["c0", "c2", "c1 +B-TYPED"], tab2: ["c0", "c2", "c1 +B-TYPED"], server: ["c0", "c2", "c1 +B-TYPED"], file: ["c0", "c2", "c1 +B-TYPED"] } },
52
+ { label: "The merge decides", ends: { tab: ["c0", "c2", "c1"], tab2: ["c0", "c2", "c1"], server: ["c0", "c2", "c1"], file: ["c0", "c2", "c1"] } },
53
+ ]);
54
+ }
55
+ )
56
+ );
57
+
58
+ // Two tabs have the notebook open. The second loses its connection and the user moves c0 to the end. Meanwhile the first tab moves c0 down by one. Then the second tab reconnects.
59
+ test(
60
+ ...story(
61
+ {
62
+ "id": "Z2",
63
+ "group": "residual",
64
+ "title": "Two people move the same cell at the same time",
65
+ "requires": [],
66
+ "needsAlignment": true,
67
+ "ordered": false
68
+ },
69
+ async s => {
70
+ await s.notebook(["c0", "c1", "c2"]);
71
+ const tab = s.tab("tab");
72
+ const tab2 = s.tab("tab2");
73
+
74
+ await s.step(1, "First tab", "opens the notebook", async () => {
75
+ await tab.open();
76
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
77
+ });
78
+ await s.step(2, "Second tab", "opens the same notebook", async () => {
79
+ await tab2.open();
80
+ await s.expectTab(tab2, ["c0", "c1", "c2"]);
81
+ });
82
+ await s.step(3, "Second tab", "loses its connection", async () => {
83
+ await tab2.goOffline();
84
+ });
85
+ await s.step(4, "Second tab", "moves c0 to the end of the notebook", async () => {
86
+ await tab2.moveCell(0, 2);
87
+ await s.expectTab(tab2, ["c1", "c2", "c0"]);
88
+ });
89
+ await s.step(5, "First tab", "meanwhile moves c0 down by one", async () => {
90
+ await tab.moveCell(0, 1);
91
+ await s.settle(tab);
92
+ await s.expectTab(tab, ["c1", "c0", "c2"]);
93
+ });
94
+ await s.step(6, "Second tab", "reconnects", async () => {
95
+ await tab2.goOnline();
96
+ });
97
+ await s.step(7, "Server", "merges the two moves", async () => {
98
+ // nothing for a test to do: the storyboard states what is so
99
+ });
100
+ await s.step(8, "File on disk", "autosave", async () => {
101
+ // nothing for a test to do: the storyboard states what is so
102
+ });
103
+
104
+ await s.ends([
105
+ { label: "The cell exists once", ends: { tab: ["c1", "c0", "c2"], tab2: ["c1", "c0", "c2"], server: ["c1", "c0", "c2"], file: ["c1", "c0", "c2"] } },
106
+ { label: "The merge decides", ends: { tab: ["c1", "c0", "c0", "c2"], tab2: ["c1", "c0", "c0", "c2"], server: ["c1", "c0", "c0", "c2"], file: ["c1", "c0", "c0", "c2"] } },
107
+ ]);
108
+ }
109
+ )
110
+ );
111
+
112
+ // Two tabs have the notebook open. The second loses its connection and the user types into c1. Meanwhile the first tab deletes c1. Then the second tab reconnects.
113
+ test(
114
+ ...story(
115
+ {
116
+ "id": "Z3",
117
+ "group": "residual",
118
+ "title": "One person deletes a cell while another types into it offline",
119
+ "requires": [],
120
+ "needsAlignment": true
121
+ },
122
+ async s => {
123
+ await s.notebook(["c0", "c1", "c2"]);
124
+ const tab = s.tab("tab");
125
+ const tab2 = s.tab("tab2");
126
+
127
+ await s.step(1, "First tab", "opens the notebook", async () => {
128
+ await tab.open();
129
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
130
+ });
131
+ await s.step(2, "Second tab", "opens the same notebook", async () => {
132
+ await tab2.open();
133
+ await s.expectTab(tab2, ["c0", "c1", "c2"]);
134
+ });
135
+ await s.step(3, "Second tab", "loses its connection", async () => {
136
+ await tab2.goOffline();
137
+ });
138
+ await s.step(4, "Second tab", "types “+B-TYPED” at the end of c1", async () => {
139
+ await tab2.type(1, " +B-TYPED");
140
+ await s.expectTab(tab2, ["c0", "c1 +B-TYPED", "c2"]);
141
+ });
142
+ await s.step(5, "First tab", "meanwhile deletes c1", async () => {
143
+ await tab.deleteCell(1);
144
+ await s.settle(tab);
145
+ await s.expectTab(tab, ["c0", "c2"]);
146
+ });
147
+ await s.step(6, "Second tab", "reconnects", async () => {
148
+ await tab2.goOnline();
149
+ });
150
+ await s.step(7, "Server", "merges: the cell is deleted for everyone", async () => {
151
+ // nothing for a test to do: the storyboard states what is so
152
+ });
153
+ await s.step(8, "File on disk", "autosave", async () => {
154
+ // nothing for a test to do: the storyboard states what is so
155
+ });
156
+
157
+ await s.ends([
158
+ { label: "The deletion wins", ends: { tab: ["c0", "c2"], tab2: ["c0", "c2"], server: ["c0", "c2"], file: ["c0", "c2"] } },
159
+ { label: "The typing is kept as a recovered copy", ends: { tab: ["c0", E.contains("c1", "+B-TYPED"), "c2"], tab2: ["c0", E.contains("c1", "+B-TYPED"), "c2"], server: ["c0", E.contains("c1", "+B-TYPED"), "c2"], file: ["c0", E.contains("c1", "+B-TYPED"), "c2"] } },
160
+ ]);
161
+ }
162
+ )
163
+ );
164
+
165
+ // Two tabs have the notebook open. The second loses its connection and the user rewrites c0 as “total = a - b”. Meanwhile the first tab rewrites c0 as “total = a * b”. Then the second tab reconnects.
166
+ test(
167
+ ...story(
168
+ {
169
+ "id": "Z4",
170
+ "group": "residual",
171
+ "title": "Two people rewrite the same cell at the same time",
172
+ "requires": [],
173
+ "needsAlignment": true
174
+ },
175
+ async s => {
176
+ await s.notebook(["c0", "c1", "c2"]);
177
+ const tab = s.tab("tab");
178
+ const tab2 = s.tab("tab2");
179
+
180
+ await s.step(1, "First tab", "opens the notebook", async () => {
181
+ await tab.open();
182
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
183
+ });
184
+ await s.step(2, "Second tab", "opens the same notebook", async () => {
185
+ await tab2.open();
186
+ await s.expectTab(tab2, ["c0", "c1", "c2"]);
187
+ });
188
+ await s.step(3, "Second tab", "loses its connection", async () => {
189
+ await tab2.goOffline();
190
+ });
191
+ await s.step(4, "Second tab", "rewrites c0 as “total = a - b”", async () => {
192
+ await tab2.rewrite(0, "total = a - b");
193
+ await s.expectTab(tab2, ["total = a - b", "c1", "c2"]);
194
+ });
195
+ await s.step(5, "First tab", "meanwhile rewrites c0 as “total = a * b”", async () => {
196
+ await tab.rewrite(0, "total = a * b");
197
+ await s.settle(tab);
198
+ await s.expectTab(tab, ["total = a * b", "c1", "c2"]);
199
+ });
200
+ await s.step(6, "Second tab", "reconnects", async () => {
201
+ await tab2.goOnline();
202
+ });
203
+ await s.step(7, "Server", "merges the two rewrites", async () => {
204
+ // nothing for a test to do: the storyboard states what is so
205
+ });
206
+ await s.step(8, "File on disk", "autosave", async () => {
207
+ // nothing for a test to do: the storyboard states what is so
208
+ });
209
+
210
+ await s.ends([
211
+ { label: "The merge decides: both are kept", ends: { tab: [E.contains("total = a - b", "total = a * b"), "c1", "c2"], tab2: [E.contains("total = a - b", "total = a * b"), "c1", "c2"], server: [E.contains("total = a - b", "total = a * b"), "c1", "c2"], file: [E.contains("total = a - b", "total = a * b"), "c1", "c2"] } },
212
+ { label: "One rewrite wins whole", ends: { tab: ["total = a * b", "c1", "c2"], tab2: ["total = a * b", "c1", "c2"], server: ["total = a * b", "c1", "c2"], file: ["total = a * b", "c1", "c2"] } },
213
+ { label: "The second rewrite becomes a cell of its own", ends: { tab: ["total = a * b", E.contains("total = a - b"), "c1", "c2"], tab2: ["total = a * b", E.contains("total = a - b"), "c1", "c2"], server: ["total = a * b", E.contains("total = a - b"), "c1", "c2"], file: ["total = a * b", E.contains("total = a - b"), "c1", "c2"] } },
214
+ ]);
215
+ }
216
+ )
217
+ );
218
+
219
+ // A tab types into c0 and the server has not saved it yet. Before it does, the file is edited outside Jupyter (git, a sync tool, an editor, an AI agent): only c2 changes.
220
+ test(
221
+ ...story(
222
+ {
223
+ "id": "Z5",
224
+ "group": "residual",
225
+ "title": "The file changes from outside while a tab has unsaved typing",
226
+ "requires": [
227
+ "fileSystem"
228
+ ],
229
+ "needsAlignment": true
230
+ },
231
+ async s => {
232
+ await s.notebook(["c0", "c1", "c2"]);
233
+ const tab = s.tab("tab");
234
+
235
+ await s.step(1, "Your tab", "opens the notebook", async () => {
236
+ await tab.open();
237
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
238
+ });
239
+ await s.step(2, "Your tab", "types “+TYPED” at the end of c0; the server has not saved it yet", async () => {
240
+ await tab.type(0, " +TYPED");
241
+ await s.settle(tab);
242
+ await s.expectTab(tab, ["c0 +TYPED", "c1", "c2"]);
243
+ });
244
+ await s.step(3, "File on disk", "is edited outside Jupyter: only c2 changes", async () => {
245
+ await s.writeFileOutside(["c0", "c1", "EXTERNAL EDIT"]);
246
+ });
247
+ await s.step(4, "Server", "notices the change before it saves, and merges it with the typing", async () => {
248
+ // nothing for a test to do: the storyboard states what is so
249
+ });
250
+ await s.step(5, "Your tab", "receives the result", async () => {
251
+ await s.expectTabEventually(tab, ["c0 +TYPED", "c1", "EXTERNAL EDIT"]);
252
+ });
253
+ await s.step(6, "File on disk", "autosave", async () => {
254
+ // nothing for a test to do: the storyboard states what is so
255
+ });
256
+
257
+ await s.ends([
258
+ { label: "The change is merged with the typing", ends: { tab: ["c0 +TYPED", "c1", "EXTERNAL EDIT"], server: ["c0 +TYPED", "c1", "EXTERNAL EDIT"], file: ["c0 +TYPED", "c1", "EXTERNAL EDIT"] } },
259
+ { label: "The file replaces the notebook", ends: { tab: ["c0", "c1", "EXTERNAL EDIT"], server: ["c0", "c1", "EXTERNAL EDIT"], file: ["c0", "c1", "EXTERNAL EDIT"] } },
260
+ ]);
261
+ }
262
+ )
263
+ );
264
+
265
+ // A tab types and the user closes it. The server dies before the next autosave, so the typing exists nowhere: not in the file, and no longer in any tab.
266
+ test(
267
+ ...story(
268
+ {
269
+ "id": "Z6",
270
+ "group": "residual",
271
+ "title": "The server dies before it saved, and no tab that held the typing is left",
272
+ "requires": [
273
+ "crashServer"
274
+ ],
275
+ "needsAlignment": true
276
+ },
277
+ async s => {
278
+ await s.notebook(["c0", "c1", "c2"]);
279
+ const tab = s.tab("tab");
280
+ const tab2 = s.tab("tab2");
281
+
282
+ await s.step(1, "Your tab", "opens the notebook", async () => {
283
+ await tab.open();
284
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
285
+ });
286
+ await s.step(2, "Your tab", "types “+TYPED”; the server holds it in memory, but the file does not have it yet", async () => {
287
+ await tab.type(0, " +TYPED");
288
+ await s.settle(tab);
289
+ await s.expectTab(tab, ["c0 +TYPED", "c1", "c2"]);
290
+ });
291
+ await s.step(3, "Your tab", "the user closes the tab", async () => {
292
+ await tab.close();
293
+ });
294
+ await s.step(4, "Server", "dies before the next autosave", async () => {
295
+ await s.crashServer();
296
+ });
297
+ await s.step(5, "Server", "starts again from the file", async () => {
298
+ await s.restartServer();
299
+ });
300
+ await s.step(6, "Second tab", "someone opens the notebook", async () => {
301
+ await tab2.open();
302
+ await s.expectTab(tab2, ["c0", "c1", "c2"]);
303
+ });
304
+
305
+ await s.ends([
306
+ { label: "The bound is accepted", ends: { tab2: ["c0", "c1", "c2"], server: ["c0", "c1", "c2"], file: ["c0", "c1", "c2"] } },
307
+ { label: "Every update is written to disk first", ends: { tab2: ["c0 +TYPED", "c1", "c2"], server: ["c0 +TYPED", "c1", "c2"], file: ["c0 +TYPED", "c1", "c2"] } },
308
+ ]);
309
+ }
310
+ )
311
+ );
312
+
313
+ // An older notebook has no cell ids, so the server gives its cells new ones every time it loads it. A tab types into c1 while it is offline, and the server forgets the old session and builds the notebook again from the file. When the tab comes back, the cells it holds and the cells of the server share no ids.
314
+ test(
315
+ ...story(
316
+ {
317
+ "id": "Z7",
318
+ "group": "residual",
319
+ "title": "Offline typing in a notebook without cell ids, after the server forgot the old session",
320
+ "requires": [
321
+ "releaseRoom"
322
+ ],
323
+ "needsAlignment": true
324
+ },
325
+ async s => {
326
+ await s.notebook(["c0", "c1", "c2"], { ids: false });
327
+ const tab = s.tab("tab");
328
+
329
+ await s.step(1, "Your tab", "opens the notebook", async () => {
330
+ await tab.open();
331
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
332
+ });
333
+ await s.step(2, "Your tab", "loses its connection", async () => {
334
+ await tab.goOffline();
335
+ });
336
+ await s.step(3, "Your tab", "types “+OFFLINE” at the end of c1", async () => {
337
+ await tab.type(1, " +OFFLINE");
338
+ await s.expectTab(tab, ["c0", "c1 +OFFLINE", "c2"]);
339
+ });
340
+ await s.step(4, "Server", "forgets the old session and builds the notebook again from the file; the cells get new ids", async () => {
341
+ await s.releaseRoom();
342
+ });
343
+ await s.step(5, "Your tab", "reconnects: without ids it cannot tell which of the server's cells is which of its own", async () => {
344
+ await tab.goOnline();
345
+ });
346
+ await s.step(6, "File on disk", "autosave", async () => {
347
+ // nothing for a test to do: the storyboard states what is so
348
+ });
349
+
350
+ await s.ends([
351
+ { label: "Merged when it can be matched, a recovered cell when it cannot", ends: { tab: ["c0", "c1", "c2", E.contains("c1", "+OFFLINE")], server: ["c0", "c1", "c2", E.contains("c1", "+OFFLINE")], file: ["c0", "c1", "c2", E.contains("c1", "+OFFLINE")] } },
352
+ { label: "Always merged into its cell", ends: { tab: ["c0", "c1 +OFFLINE", "c2"], server: ["c0", "c1 +OFFLINE", "c2"], file: ["c0", "c1 +OFFLINE", "c2"] } },
353
+ ]);
354
+ }
355
+ )
356
+ );
@@ -0,0 +1,168 @@
1
+ // GENERATED by compliance/generate.py from the storyboards. Do not edit: change the storyboard, or oracle.yaml, and generate again.
2
+ import { test } from '@jupyterlab/galata';
3
+ import { E, story } from '../../runtime/story';
4
+
5
+ // A tab that is connected and in sync types, and the server is told to shut the notebook down while the update is still waiting in its queue.
6
+ test(
7
+ ...story(
8
+ {
9
+ "id": "X1",
10
+ "group": "stop",
11
+ "title": "Shutting down with an update still waiting from a connected tab",
12
+ "requires": [
13
+ "releaseRoom"
14
+ ],
15
+ "internal": "the server's internal queue when it shuts a notebook down: no one can put an update there and shut down at that moment"
16
+ },
17
+ async s => {
18
+ await s.notebook(["c0", "c1", "c2"]);
19
+ const tab = s.tab("tab");
20
+
21
+ await s.step(1, "Your tab", "opens the notebook", async () => {
22
+ await tab.open();
23
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
24
+ });
25
+ await s.step(2, "Your tab", "types “+QUEUED” into c0; the update is waiting in the server's queue", async () => {
26
+ await tab.type(0, " +QUEUED");
27
+ await s.settle(tab);
28
+ await s.expectTab(tab, ["c0 +QUEUED", "c1", "c2"]);
29
+ });
30
+ await s.step(3, "Server", "is told to shut the notebook down while the update is still waiting", async () => {
31
+ await s.releaseRoom();
32
+ });
33
+ await s.step(4, "Server", "applies the waiting update, saves it, and finishes shutting down", async () => {
34
+ // nothing for a test to do: the storyboard states what is so
35
+ });
36
+ await s.step(5, "File on disk", "holds the edit", async () => {
37
+ // nothing for a test to do: the storyboard states what is so
38
+ });
39
+
40
+ await s.ends([
41
+ { label: "As the story ends", ends: { tab: ["c0 +QUEUED", "c1", "c2"], file: ["c0 +QUEUED", "c1", "c2"] } },
42
+ ]);
43
+ }
44
+ )
45
+ );
46
+
47
+ // A damaged message and, right behind it, a valid edit are waiting in the server's queue when the notebook is shut down.
48
+ test(
49
+ ...story(
50
+ {
51
+ "id": "X2",
52
+ "group": "stop",
53
+ "title": "Shutting down with a damaged message ahead of a valid one",
54
+ "requires": [
55
+ "releaseRoom"
56
+ ],
57
+ "internal": "the server's internal queue when it shuts a notebook down: no one can send a damaged message from the browser"
58
+ },
59
+ async s => {
60
+ await s.notebook(["c0", "c1", "c2"]);
61
+ const tab = s.tab("tab");
62
+
63
+ await s.step(1, "Your tab", "opens the notebook", async () => {
64
+ await tab.open();
65
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
66
+ });
67
+ await s.step(2, "Your tab", "types “+VALID” into c0, right after a damaged message reached the server's queue", async () => {
68
+ await tab.type(0, " +VALID");
69
+ await s.settle(tab);
70
+ await s.expectTab(tab, ["c0 +VALID", "c1", "c2"]);
71
+ });
72
+ await s.step(3, "Server", "is told to shut the notebook down while both messages are still waiting", async () => {
73
+ await s.releaseRoom();
74
+ });
75
+ await s.step(4, "Server", "skips the damaged message, applies the valid edit, saves it, and finishes shutting down", async () => {
76
+ // nothing for a test to do: the storyboard states what is so
77
+ });
78
+ await s.step(5, "File on disk", "holds the valid edit", async () => {
79
+ // nothing for a test to do: the storyboard states what is so
80
+ });
81
+
82
+ await s.ends([
83
+ { label: "As the story ends", ends: { tab: ["c0 +VALID", "c1", "c2"], file: ["c0 +VALID", "c1", "c2"] } },
84
+ ]);
85
+ }
86
+ )
87
+ );
88
+
89
+ // Another part of the server (for example, the kernel sessions) registers some cleanup work to run when the notebook is shut down. The work takes a moment. The server must not report the notebook as shut down before it is done.
90
+ test(
91
+ ...story(
92
+ {
93
+ "id": "X3",
94
+ "group": "stop",
95
+ "title": "Shutting down waits for the cleanup work registered for it",
96
+ "requires": [
97
+ "releaseRoom",
98
+ "wireFaults"
99
+ ],
100
+ "internal": "work the server registers for its own shutdown: nothing a person does or sees"
101
+ },
102
+ async s => {
103
+ await s.notebook(["c0", "c1", "c2"]);
104
+
105
+ await s.step(1, "Server", "another part of the server registers some cleanup work for when the notebook shuts down; it takes a moment", async () => {
106
+ // nothing for a test to do: the storyboard states what is so
107
+ });
108
+ await s.step(2, "Server", "is told to shut the notebook down", async () => {
109
+ await s.releaseRoom();
110
+ });
111
+ await s.step(3, "Server", "waits for the cleanup work to finish", async () => {
112
+ // waits for the cleanup work to finish: the backend's adapter causes this
113
+ });
114
+ await s.step(4, "Server", "only then reports that the notebook is saved and shut down", async () => {
115
+ // nothing for a test to do: the storyboard states what is so
116
+ });
117
+
118
+ await s.ends([
119
+ { label: "As the story ends", ends: { } },
120
+ ]);
121
+ }
122
+ )
123
+ );
124
+
125
+ // A tab sends an update and leaves before the server handled it. The update is still in the server's queue when the notebook is shut down.
126
+ test(
127
+ ...story(
128
+ {
129
+ "id": "X4",
130
+ "group": "stop",
131
+ "title": "Shutting down with an update from a tab that has already left",
132
+ "requires": [
133
+ "releaseRoom"
134
+ ],
135
+ "internal": "the server's internal queue when it shuts a notebook down: whether an update is still waiting when a tab closes is a race"
136
+ },
137
+ async s => {
138
+ await s.notebook(["c0", "c1", "c2"]);
139
+ const tab = s.tab("tab");
140
+
141
+ await s.step(1, "Your tab", "opens the notebook", async () => {
142
+ await tab.open();
143
+ await s.expectTab(tab, ["c0", "c1", "c2"]);
144
+ });
145
+ await s.step(2, "Your tab", "types “+DEPARTED” into c0; the update is waiting in the server's queue", async () => {
146
+ await tab.type(0, " +DEPARTED");
147
+ await s.settle(tab);
148
+ await s.expectTab(tab, ["c0 +DEPARTED", "c1", "c2"]);
149
+ });
150
+ await s.step(3, "Your tab", "closes the tab before the server handled the update", async () => {
151
+ await tab.close();
152
+ });
153
+ await s.step(4, "Server", "is told to shut the notebook down", async () => {
154
+ await s.releaseRoom();
155
+ });
156
+ await s.step(5, "Server", "drops the update of the tab that has left, and finishes shutting down", async () => {
157
+ // nothing for a test to do: the storyboard states what is so
158
+ });
159
+ await s.step(6, "File on disk", "holds the notebook as it was", async () => {
160
+ // nothing for a test to do: the storyboard states what is so
161
+ });
162
+
163
+ await s.ends([
164
+ { label: "As the story ends", ends: { file: ["c0", "c1", "c2"] } },
165
+ ]);
166
+ }
167
+ )
168
+ );
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "commonjs",
5
+ "moduleResolution": "node",
6
+ "lib": ["ES2022", "DOM"],
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "noEmit": true,
11
+ "resolveJsonModule": true
12
+ },
13
+ "include": ["runtime", "adapters", "tests", "playwright.config.ts"]
14
+ }