@rimori/playwright-testing 0.3.5-next.2 → 0.3.5

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.
@@ -231,7 +231,6 @@ export declare class RimoriTestEnvironment {
231
231
  mockGetVoice: (values: Buffer, options?: MockOptions) => void;
232
232
  mockGetTextFromVoice: (text: string, options?: MockOptions) => void;
233
233
  mockGetObject: (value: Record<string, unknown>, options?: MockOptions) => void;
234
- mockGetStreamedObject: (value: Record<string, unknown>, options?: MockOptions) => void;
235
234
  };
236
235
  /**
237
236
  * Helpers for tracking browser audio playback in tests.
@@ -47,13 +47,7 @@ class RimoriTestEnvironment {
47
47
  this.addSupabaseRoute('plugin_settings', response, { ...options, method: 'POST' });
48
48
  },
49
49
  mockGetUserInfo: (userInfo, options) => {
50
- // Update the rimoriInfo.profile so that MessageChannelSimulator returns the correct user info
51
- this.rimoriInfo.profile = { ...this.rimoriInfo.profile, ...userInfo };
52
- // Also update the MessageChannelSimulator if it exists (setup() has been called)
53
- if (this.messageChannelSimulator) {
54
- this.messageChannelSimulator.setUserInfo(this.rimoriInfo.profile);
55
- }
56
- this.addSupabaseRoute('/user-info', this.rimoriInfo.profile, { ...options, delay: 0 });
50
+ this.addSupabaseRoute('/user-info', { ...this.rimoriInfo.profile, ...userInfo }, { ...options, delay: 0 });
57
51
  },
58
52
  mockGetPluginInfo: (pluginInfo, options) => {
59
53
  this.addSupabaseRoute('/plugin-info', pluginInfo, options);
@@ -224,9 +218,6 @@ class RimoriTestEnvironment {
224
218
  mockGetObject: (value, options) => {
225
219
  this.addBackendRoute('/ai/llm-object', value, { ...options, method: 'POST' });
226
220
  },
227
- mockGetStreamedObject: (value, options) => {
228
- this.addBackendRoute('/ai/llm-object', value, { ...options, isStreaming: true });
229
- },
230
221
  };
231
222
  /**
232
223
  * Helpers for tracking browser audio playback in tests.
@@ -830,19 +821,10 @@ class RimoriTestEnvironment {
830
821
  if (typeof matchingMock.value === 'function') {
831
822
  responseValue = await matchingMock.value(request);
832
823
  }
833
- // Handle streaming responses (for mockGetSteamedText and mockGetStreamedObject)
824
+ // Handle streaming responses (for mockGetSteamedText)
834
825
  // Since Playwright requires complete body, we format as SSE without delays
835
- if (matchingMock.isStreaming) {
836
- let body;
837
- if (typeof responseValue === 'string') {
838
- // Text streaming (mockGetSteamedText)
839
- body = this.formatAsSSE(responseValue);
840
- }
841
- else {
842
- // Object streaming (mockGetStreamedObject)
843
- // Format as SSE with JSON payload, followed by [DONE] marker
844
- body = `data: ${JSON.stringify(responseValue)}\n\ndata: [DONE]\n\n`;
845
- }
826
+ if (matchingMock.isStreaming && typeof responseValue === 'string') {
827
+ const body = this.formatAsSSE(responseValue);
846
828
  return await route.fulfill({
847
829
  status: 200,
848
830
  headers: { 'Content-Type': 'text/event-stream' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimori/playwright-testing",
3
- "version": "0.3.5-next.2",
3
+ "version": "0.3.5",
4
4
  "description": "Playwright testing utilities for Rimori plugins and workers",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -23,11 +23,11 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@playwright/test": "^1.40.0",
26
- "@rimori/client": "2.5.10-next.0"
26
+ "@rimori/client": "^2.5.8"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@playwright/test": "^1.40.0",
30
- "@rimori/client": "2.5.10-next.0",
30
+ "@rimori/client": "^2.5.8",
31
31
  "@types/node": "^20.12.7",
32
32
  "rimraf": "^5.0.7",
33
33
  "typescript": "^5.7.2"