@cosmicdrift/kumiko-testing 0.392.2 → 0.394.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.392.2",
3
+ "version": "0.394.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.392.2",
107
- "@cosmicdrift/kumiko-guards": "0.392.2",
108
- "@cosmicdrift/kumiko-types": "0.392.2",
106
+ "@cosmicdrift/kumiko-framework": "0.394.0",
107
+ "@cosmicdrift/kumiko-guards": "0.394.0",
108
+ "@cosmicdrift/kumiko-types": "0.394.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.392.2",
133
- "@cosmicdrift/kumiko-dev-server": "0.392.2",
132
+ "@cosmicdrift/kumiko-bundled-features": "0.394.0",
133
+ "@cosmicdrift/kumiko-dev-server": "0.394.0",
134
134
  "@happy-dom/global-registrator": "^21.0.4",
135
135
  "@playwright/test": "^1.62.1",
136
136
  "@testing-library/dom": "^10.4.1",
package/src/changes.json CHANGED
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.394.0",
4
+ "type": "improvement",
5
+ "title": "request-helper sessions carry a realistic IP and user agent",
6
+ "detail": "Sessions the request helper opens record a documentation-range IP and a desktop Chrome user agent instead of \"test\" and \"request-helper\", so seeded sample apps show plausible rows on My sessions."
7
+ },
2
8
  {
3
9
  "version": "0.392.0",
4
10
  "type": "improvement",
@@ -113,6 +113,10 @@ export type RequestHelperOptions = {
113
113
  readonly sessionCreator?: SessionCreator;
114
114
  };
115
115
 
116
+ const SEEDED_SESSION_IP = "198.51.100.23";
117
+ const SEEDED_SESSION_USER_AGENT =
118
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36";
119
+
116
120
  export function createRequestHelper(
117
121
  app: Hono,
118
122
  jwt: JwtHelper,
@@ -142,7 +146,12 @@ export function createRequestHelper(
142
146
  const key = `${user.id}:${user.tenantId}`;
143
147
  let sidPromise = sidByUserKey.get(key);
144
148
  if (sidPromise === undefined) {
145
- sidPromise = options.sessionCreator(user, { ip: "test", userAgent: "request-helper" });
149
+ // Sample apps seed through this helper and show the rows on "My sessions",
150
+ // so the values read like a real desktop login (IP from TEST-NET-2).
151
+ sidPromise = options.sessionCreator(user, {
152
+ ip: SEEDED_SESSION_IP,
153
+ userAgent: SEEDED_SESSION_USER_AGENT,
154
+ });
146
155
  sidByUserKey.set(key, sidPromise);
147
156
  }
148
157
  const sid = await sidPromise;