@rimori/playwright-testing 0.3.15-next.0 → 0.3.15-next.2

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.
@@ -567,9 +567,8 @@ class RimoriTestEnvironment {
567
567
  this.page.route(`${pluginUrl}/locales/**`, async (route) => {
568
568
  const request = route.request();
569
569
  const url = new URL(request.url());
570
- const devServerUrl = `http://${url.host}/locales/en.json`;
570
+ const devServerUrl = `http://${url.host}${url.pathname}`;
571
571
  // console.log('Fetching locales from: ' + devServerUrl);
572
- // throw new Error('Test: ' + devServerUrl);
573
572
  try {
574
573
  // Fetch from the dev server
575
574
  const response = await fetch(devServerUrl);
@@ -616,10 +615,6 @@ class RimoriTestEnvironment {
616
615
  // These are registered AFTER any test-level mocks so they act as low-priority fallbacks.
617
616
  // POST /ai/session — required by event.request() and any AI call (session.ensure())
618
617
  this.addBackendRoute('/ai/session', { session_token_id: 'test-session-token' }, { method: 'POST' });
619
- // POST /ai/llm — fallback empty stream for Avatar conversations and other background AI calls
620
- this.addBackendRoute('/ai/llm', '', { method: 'POST', isStreaming: true });
621
- // POST /voice/tts — fallback empty response for AudioPlayer (test env has no real audio)
622
- this.addBackendRoute('/voice/tts', {}, { method: 'POST' });
623
618
  // POST /knowledge/for-topic — fallback for daily-plan knowledge lookups
624
619
  this.addBackendRoute('/knowledge/for-topic', { id: 'test-knowledge-id' }, { method: 'POST' });
625
620
  // Initialize MessageChannelSimulator to simulate parent-iframe communication
@@ -33,8 +33,6 @@ export declare class SettingsStateManager {
33
33
  /**
34
34
  * Manually set settings (useful for test setup).
35
35
  * Accepts either a full PluginSettings row (with `id`, `plugin_id`, `settings`, etc.)
36
- * or a plain inner-settings object (e.g. `{ skillAssessmentCompletedAt: '...' }`).
37
- * If an inner-settings object is detected it is automatically wrapped in the proper row structure.
38
36
  */
39
37
  setSettings(settings: PluginSettings | null): void;
40
38
  /**
@@ -61,32 +61,9 @@ class SettingsStateManager {
61
61
  /**
62
62
  * Manually set settings (useful for test setup).
63
63
  * Accepts either a full PluginSettings row (with `id`, `plugin_id`, `settings`, etc.)
64
- * or a plain inner-settings object (e.g. `{ skillAssessmentCompletedAt: '...' }`).
65
- * If an inner-settings object is detected it is automatically wrapped in the proper row structure.
66
64
  */
67
65
  setSettings(settings) {
68
- if (settings === null) {
69
- this.settings = null;
70
- return;
71
- }
72
- // Detect a full PluginSettings row vs a plain inner-settings object.
73
- // A full row has at least one of these known structural keys.
74
- const isFullRow = 'id' in settings ||
75
- 'plugin_id' in settings ||
76
- 'guild_id' in settings ||
77
- 'settings' in settings ||
78
- 'is_guild_setting' in settings ||
79
- 'user_id' in settings;
80
- if (isFullRow) {
81
- this.settings = settings;
82
- }
83
- else {
84
- // Treat as inner settings — wrap in the existing row structure
85
- this.settings = {
86
- ...(this.settings ?? {}),
87
- settings: settings,
88
- };
89
- }
66
+ this.settings = settings;
90
67
  }
91
68
  /**
92
69
  * Check if settings exist
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimori/playwright-testing",
3
- "version": "0.3.15-next.0",
3
+ "version": "0.3.15-next.2",
4
4
  "description": "Playwright testing utilities for Rimori plugins and workers",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -26,11 +26,11 @@
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@playwright/test": "^1.40.0",
29
- "@rimori/client": "^2.5.21"
29
+ "@rimori/client": "2.5.21-next.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@playwright/test": "^1.40.0",
33
- "@rimori/client": "^2.5.21",
33
+ "@rimori/client": "2.5.21-next.0",
34
34
  "@types/node": "^20.12.7",
35
35
  "rimraf": "^5.0.7",
36
36
  "typescript": "^5.7.2"