@dxos/shell 0.6.12-staging.e11e696 → 0.6.12

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.
@@ -2,7 +2,8 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
- import { expect, test } from '@playwright/test';
5
+ import { test } from '@playwright/test';
6
+ import { expect } from 'chai';
6
7
 
7
8
  import { sleep } from '@dxos/async';
8
9
  import { Invitation } from '@dxos/react-client/invitations';
@@ -46,7 +47,7 @@ test.describe('Invitations', () => {
46
47
  await manager.authenticateInvitation('device', authCode, manager.peer(1));
47
48
  await manager.doneInvitation('device', manager.peer(1));
48
49
 
49
- expect(await manager.getDisplayName(0)).toEqual(await manager.getDisplayName(1));
50
+ expect(await manager.getDisplayName(0)).to.equal(await manager.getDisplayName(1));
50
51
  });
51
52
 
52
53
  test('no auth method', async () => {
@@ -58,7 +59,7 @@ test.describe('Invitations', () => {
58
59
  await manager.acceptInvitation(1, 'device', invitation);
59
60
  await manager.doneInvitation('device', manager.peer(1));
60
61
 
61
- expect(await manager.getDisplayName(0)).toEqual(await manager.getDisplayName(1));
62
+ expect(await manager.getDisplayName(0)).to.equal(await manager.getDisplayName(1));
62
63
  });
63
64
 
64
65
  test('invalid & retry auth code', async () => {
@@ -74,7 +75,7 @@ test.describe('Invitations', () => {
74
75
  await manager.authenticateInvitation('device', authCode, manager.peer(1));
75
76
  await manager.doneInvitation('device', manager.peer(1));
76
77
 
77
- expect(await manager.getDisplayName(0)).toEqual(await manager.getDisplayName(1));
78
+ expect(await manager.getDisplayName(0)).to.equal(await manager.getDisplayName(1));
78
79
  });
79
80
 
80
81
  // TODO(wittjosiah): Remove? This seems to invalidate the invitation now.
@@ -93,7 +94,7 @@ test.describe('Invitations', () => {
93
94
  await manager.clearAuthCode('device', manager.peer(1));
94
95
  await manager.authenticateInvitation('device', '000003', manager.peer(1));
95
96
 
96
- expect(await manager.invitationFailed(manager.peer(1))).toBe(true);
97
+ expect(await manager.invitationFailed(manager.peer(1))).to.be.true;
97
98
 
98
99
  await manager.resetInvitation(manager.peer(1));
99
100
  await manager.invitationInputContinue('device', manager.peer(1));
@@ -101,7 +102,7 @@ test.describe('Invitations', () => {
101
102
  await manager.authenticateInvitation('device', authCode, manager.peer(1));
102
103
  await manager.doneInvitation('device', manager.peer(1));
103
104
 
104
- expect(await manager.getDisplayName(0)).toEqual(await manager.getDisplayName(1));
105
+ expect(await manager.getDisplayName(0)).to.equal(await manager.getDisplayName(1));
105
106
  });
106
107
 
107
108
  test('invitation timeout', async () => {
@@ -112,7 +113,7 @@ test.describe('Invitations', () => {
112
113
  await manager.openPanel(1, 'identity');
113
114
  await manager.acceptInvitation(1, 'device', invitation);
114
115
 
115
- expect(await manager.invitationFailed(manager.peer(1))).toBe(true);
116
+ expect(await manager.invitationFailed(manager.peer(1))).to.be.true;
116
117
  });
117
118
 
118
119
  // TODO(thure): This is skipped because the UI no longer affords cancelling device invitations, consider removing.
@@ -124,10 +125,10 @@ test.describe('Invitations', () => {
124
125
 
125
126
  await manager.openPanel(1, 'identity');
126
127
  await manager.acceptInvitation(1, 'device', invitation);
127
- expect(await manager.readyToAuthenticate('device', manager.peer(1))).toBe(true);
128
+ expect(await manager.readyToAuthenticate('device', manager.peer(1))).to.be.true;
128
129
  await manager.cancelInvitation('device', 'host', manager.peer(0));
129
130
 
130
- expect(await manager.invitationFailed(manager.peer(1))).toBe(true);
131
+ expect(await manager.invitationFailed(manager.peer(1))).to.be.true;
131
132
  });
132
133
 
133
134
  // TODO(wittjosiah): Remove? This seems to invalidate the invitation now.
@@ -146,7 +147,7 @@ test.describe('Invitations', () => {
146
147
  await manager.authenticateInvitation('device', authCode, manager.peer(1));
147
148
  await manager.doneInvitation('device', manager.peer(1));
148
149
 
149
- expect(await manager.getDisplayName(0)).toEqual(await manager.getDisplayName(1));
150
+ expect(await manager.getDisplayName(0)).to.equal(await manager.getDisplayName(1));
150
151
  });
151
152
 
152
153
  // TODO(thure): The design no longer affords signalling an identity’s network status. Remove or adjust test, or adjust design.
@@ -158,18 +159,18 @@ test.describe('Invitations', () => {
158
159
 
159
160
  await manager.openPanel(1, 'identity');
160
161
  await manager.acceptInvitation(1, 'device', invitation);
161
- expect(await manager.readyToAuthenticate('device', manager.peer(1))).toBe(true);
162
+ expect(await manager.readyToAuthenticate('device', manager.peer(1))).to.be.true;
162
163
  await manager.toggleNetworkStatus(0);
163
- expect(await manager.getNetworkStatus(0)).toEqual(ConnectionState.OFFLINE);
164
+ expect(await manager.getNetworkStatus(0)).to.equal(ConnectionState.OFFLINE);
164
165
  await manager.toggleNetworkStatus(0);
165
- expect(await manager.getNetworkStatus(0)).toEqual(ConnectionState.ONLINE);
166
+ expect(await manager.getNetworkStatus(0)).to.equal(ConnectionState.ONLINE);
166
167
  await manager.resetInvitation(manager.peer(1));
167
168
  await manager.invitationInputContinue('device', manager.peer(1));
168
169
  await manager.clearAuthCode('device', manager.peer(1));
169
170
  await manager.authenticateInvitation('device', authCode, manager.peer(1));
170
171
  await manager.doneInvitation('device', manager.peer(1));
171
172
 
172
- expect(await manager.getDisplayName(0)).toEqual(await manager.getDisplayName(1));
173
+ expect(await manager.getDisplayName(0)).to.equal(await manager.getDisplayName(1));
173
174
  });
174
175
  });
175
176
 
@@ -189,7 +190,7 @@ test.describe('Invitations', () => {
189
190
  await manager.doneInvitation('space', manager.peer(1));
190
191
 
191
192
  await manager.openPanel(0, 'spaces');
192
- expect(await manager.getSpaceName(0, 1)).toEqual(await manager.getSpaceName(1, 1));
193
+ expect(await manager.getSpaceName(0, 1)).to.equal(await manager.getSpaceName(1, 1));
193
194
  });
194
195
 
195
196
  test('already joined', async () => {
@@ -208,7 +209,7 @@ test.describe('Invitations', () => {
208
209
  await manager.acceptInvitation(1, 'space', invitation2);
209
210
  await manager.doneInvitation('space', manager.peer(1));
210
211
 
211
- expect(await manager.getSpaceMembersCount(0)).toEqual(2);
212
+ expect(await manager.getSpaceMembersCount(0)).to.equal(2);
212
213
  });
213
214
 
214
215
  test('no auth method', async () => {
@@ -223,7 +224,7 @@ test.describe('Invitations', () => {
223
224
  await manager.doneInvitation('space', manager.peer(1));
224
225
 
225
226
  await manager.openPanel(0, 'spaces');
226
- expect(await manager.getSpaceName(0, 1)).toEqual(await manager.getSpaceName(1, 1));
227
+ expect(await manager.getSpaceName(0, 1)).to.equal(await manager.getSpaceName(1, 1));
227
228
  });
228
229
 
229
230
  test('invalid & retry auth code', async () => {
@@ -238,14 +239,14 @@ test.describe('Invitations', () => {
238
239
  await manager.acceptInvitation(1, 'space', invitation);
239
240
  await manager.authenticateInvitation('space', '000000', manager.peer(1));
240
241
 
241
- expect(await manager.authenticatorIsVisible('space', manager.peer(1))).toBe(true);
242
+ expect(await manager.authenticatorIsVisible('space', manager.peer(1))).to.be.true;
242
243
 
243
244
  await manager.clearAuthCode('space', manager.peer(1));
244
245
  await manager.authenticateInvitation('space', authCode, manager.peer(1));
245
246
  await manager.doneInvitation('space', manager.peer(1));
246
247
 
247
248
  await manager.openPanel(0, 'spaces');
248
- expect(await manager.getSpaceName(0, 1)).toEqual(await manager.getSpaceName(1, 1));
249
+ expect(await manager.getSpaceName(0, 1)).to.equal(await manager.getSpaceName(1, 1));
249
250
  });
250
251
 
251
252
  // TODO(wittjosiah): Remove? This seems to invalidate the invitation now.
@@ -266,7 +267,7 @@ test.describe('Invitations', () => {
266
267
  await manager.clearAuthCode('space', manager.peer(1));
267
268
  await manager.authenticateInvitation('space', '000003', manager.peer(1));
268
269
 
269
- expect(await manager.invitationFailed(manager.peer(1))).toBe(true);
270
+ expect(await manager.invitationFailed(manager.peer(1))).to.be.true;
270
271
 
271
272
  await manager.resetInvitation(manager.peer(1));
272
273
  await manager.invitationInputContinue('space', manager.peer(1));
@@ -275,7 +276,7 @@ test.describe('Invitations', () => {
275
276
  await manager.doneInvitation('space', manager.peer(1));
276
277
 
277
278
  await manager.openPanel(0, 'spaces');
278
- expect(await manager.getSpaceName(0, 1)).toEqual(await manager.getSpaceName(1, 1));
279
+ expect(await manager.getSpaceName(0, 1)).to.equal(await manager.getSpaceName(1, 1));
279
280
  });
280
281
 
281
282
  test('invitation timeout', async () => {
@@ -288,7 +289,7 @@ test.describe('Invitations', () => {
288
289
  await manager.openPanel(1, 'join');
289
290
  await manager.acceptInvitation(1, 'space', invitation);
290
291
 
291
- expect(await manager.invitationFailed(manager.peer(1))).toBe(true);
292
+ expect(await manager.invitationFailed(manager.peer(1))).to.be.true;
292
293
  });
293
294
 
294
295
  // TODO(wittjosiah): Cancel not propagating.
@@ -301,10 +302,10 @@ test.describe('Invitations', () => {
301
302
  await manager.createIdentity(1);
302
303
  await manager.openPanel(1, 'join');
303
304
  await manager.acceptInvitation(1, 'space', invitation);
304
- expect(await manager.readyToAuthenticate('space', manager.peer(1))).toBe(true);
305
+ expect(await manager.readyToAuthenticate('space', manager.peer(1))).to.be.true;
305
306
  await manager.cancelInvitation('space', 'host', manager.peer(0));
306
307
 
307
- expect(await manager.invitationFailed(manager.peer(1))).toBe(true);
308
+ expect(await manager.invitationFailed(manager.peer(1))).to.be.true;
308
309
  });
309
310
 
310
311
  // TODO(wittjosiah): Remove? This seems to invalidate the invitation now.
@@ -326,7 +327,7 @@ test.describe('Invitations', () => {
326
327
  await manager.doneInvitation('space', manager.peer(1));
327
328
 
328
329
  await manager.openPanel(0, 'spaces');
329
- expect(await manager.getSpaceName(0, 1)).toEqual(await manager.getSpaceName(1, 1));
330
+ expect(await manager.getSpaceName(0, 1)).to.equal(await manager.getSpaceName(1, 1));
330
331
  });
331
332
 
332
333
  // TODO(thure): The design no longer affords signalling an identity’s network status. Remove or adjust test, or adjust design.
@@ -340,11 +341,11 @@ test.describe('Invitations', () => {
340
341
  await manager.createIdentity(1);
341
342
  await manager.openPanel(1, 'join');
342
343
  await manager.acceptInvitation(1, 'space', invitation);
343
- expect(await manager.readyToAuthenticate('space', manager.peer(1))).toBe(true);
344
+ expect(await manager.readyToAuthenticate('space', manager.peer(1))).to.be.true;
344
345
  await manager.toggleNetworkStatus(0);
345
- expect(await manager.getNetworkStatus(0)).toEqual(ConnectionState.OFFLINE);
346
+ expect(await manager.getNetworkStatus(0)).to.equal(ConnectionState.OFFLINE);
346
347
  await manager.toggleNetworkStatus(0);
347
- expect(await manager.getNetworkStatus(0)).toEqual(ConnectionState.ONLINE);
348
+ expect(await manager.getNetworkStatus(0)).to.equal(ConnectionState.ONLINE);
348
349
  await manager.resetInvitation(manager.peer(1));
349
350
  await manager.invitationInputContinue('space', manager.peer(1));
350
351
  await manager.clearAuthCode('space', manager.peer(1));
@@ -352,7 +353,7 @@ test.describe('Invitations', () => {
352
353
  await manager.doneInvitation('space', manager.peer(1));
353
354
 
354
355
  await manager.openPanel(0, 'spaces');
355
- expect(await manager.getSpaceName(0, 1)).toEqual(await manager.getSpaceName(1, 1));
356
+ expect(await manager.getSpaceName(0, 1)).to.equal(await manager.getSpaceName(1, 1));
356
357
  });
357
358
 
358
359
  test('multiple concurrent invitations', async () => {
@@ -384,9 +385,9 @@ test.describe('Invitations', () => {
384
385
  await manager.doneInvitation('space', manager.peer(2));
385
386
 
386
387
  await manager.openPanel(0, 'spaces');
387
- expect(await manager.getSpaceName(0, 1)).toEqual(await manager.getSpaceName(1, 1));
388
- expect(await manager.getSpaceName(0, 1)).toEqual(await manager.getSpaceName(2, 1));
389
- expect(await manager.getSpaceName(1, 1)).toEqual(await manager.getSpaceName(2, 1));
388
+ expect(await manager.getSpaceName(0, 1)).to.equal(await manager.getSpaceName(1, 1));
389
+ expect(await manager.getSpaceName(0, 1)).to.equal(await manager.getSpaceName(2, 1));
390
+ expect(await manager.getSpaceName(1, 1)).to.equal(await manager.getSpaceName(2, 1));
390
391
  });
391
392
  });
392
393
  });
@@ -2,17 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { nxE2EPreset } from '@nx/playwright/preset';
6
- import { defineConfig } from '@playwright/test';
5
+ import { defaultPlaywrightConfig } from '@dxos/test/playwright';
7
6
 
8
- import { e2ePreset } from '@dxos/test-utils/playwright';
9
-
10
- export default defineConfig({
11
- ...nxE2EPreset(__filename, { testDir: __dirname }),
12
- ...e2ePreset(__dirname),
13
- webServer: {
14
- command: 'pnpm -w nx storybook-e2e stories',
15
- port: 9009,
16
- reuseExistingServer: !process.env.CI,
17
- },
18
- });
7
+ export default defaultPlaywrightConfig;