@cosmicdrift/kumiko-testing 0.398.0 → 0.399.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-testing",
3
- "version": "0.398.0",
3
+ "version": "0.399.0",
4
4
  "description": "Test template for Kumiko apps: per-flow seedTenant, app test stack, canonical test preloads, bunfig generator and integration runner.",
5
5
  "license": "MIT",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -103,9 +103,9 @@
103
103
  "kumiko-testing": "./bin/kumiko-testing.ts"
104
104
  },
105
105
  "dependencies": {
106
- "@cosmicdrift/kumiko-framework": "0.398.0",
107
- "@cosmicdrift/kumiko-guards": "0.398.0",
108
- "@cosmicdrift/kumiko-types": "0.398.0",
106
+ "@cosmicdrift/kumiko-framework": "0.399.0",
107
+ "@cosmicdrift/kumiko-guards": "0.399.0",
108
+ "@cosmicdrift/kumiko-types": "0.399.0",
109
109
  "zod": "^4.6.7"
110
110
  },
111
111
  "peerDependencies": {
@@ -129,8 +129,8 @@
129
129
  }
130
130
  },
131
131
  "devDependencies": {
132
- "@cosmicdrift/kumiko-bundled-features": "0.398.0",
133
- "@cosmicdrift/kumiko-dev-server": "0.398.0",
132
+ "@cosmicdrift/kumiko-bundled-features": "0.399.0",
133
+ "@cosmicdrift/kumiko-dev-server": "0.399.0",
134
134
  "@happy-dom/global-registrator": "^21.0.4",
135
135
  "@playwright/test": "^1.62.1",
136
136
  "@testing-library/dom": "^10.4.2",
package/src/changes.json CHANGED
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.399.0",
4
+ "type": "fix",
5
+ "title": "loginViaUi waits for the landing page after the login",
6
+ "detail": "loginViaUi returned as soon as the login form disappeared, while the app was still navigating to its landing page. A page.goto right after it was then interrupted by that navigation (\"Navigation to … is interrupted by another navigation to …/d\"). It now waits until the URL has left /login, with and without the MFA step."
7
+ },
2
8
  {
3
9
  "version": "0.394.0",
4
10
  "type": "improvement",
@@ -267,13 +267,20 @@ export async function loginViaUi(page: Page, credentials: LoginCredentials): Pro
267
267
  await page.locator("#login-password").fill(credentials.password);
268
268
  await page.locator("#login-password").press("Enter");
269
269
  await expect(page.locator("#login-password")).toHaveCount(0);
270
- // skip: no secret, so no MFA step expected
271
- if (credentials.mfaTotpSecret === undefined) return;
270
+ if (credentials.mfaTotpSecret !== undefined) {
271
+ await completeMfaStep(page, credentials.mfaTotpSecret);
272
+ }
273
+ // The form disappears before the app navigates to its landing page; a goto issued in
274
+ // between is interrupted by that navigation.
275
+ await page.waitForURL((url) => !url.pathname.startsWith("/login"));
276
+ }
277
+
278
+ async function completeMfaStep(page: Page, mfaTotpSecret: string): Promise<void> {
272
279
  // A secret means an enrolled factor, so the MFA step must come; waiting for it
273
280
  // avoids racing the transition from the password form.
274
281
  const codeField = page.locator("#mfa-verify-code");
275
282
  await expect(codeField).toBeVisible();
276
- const code = await unburnedTotpCode(credentials.mfaTotpSecret);
283
+ const code = await unburnedTotpCode(mfaTotpSecret);
277
284
  // The sixth digit submits on its own and disables the field; an Enter press would race that.
278
285
  await Promise.all([
279
286
  page.waitForResponse(