@rimori/playwright-testing 0.3.21-next.0 → 0.3.21-next.1
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.
|
@@ -220,10 +220,13 @@ export declare class RimoriTestEnvironment {
|
|
|
220
220
|
triggerOnSidePanelAction: (payload: SidebarAction) => Promise<void>;
|
|
221
221
|
/**
|
|
222
222
|
* Triggers a main panel action event as the parent application would.
|
|
223
|
-
* This simulates how rimori-main
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
223
|
+
* This simulates how rimori-main sends the MainPanelAction back to the plugin after
|
|
224
|
+
* the plugin calls onMainPanelAction() and emits '{pluginId}.action.requestMain'.
|
|
225
|
+
*
|
|
226
|
+
* We listen for that outbound emit and respond by injecting a fresh event with
|
|
227
|
+
* sender='rimori-main'. This avoids the EventBus per-listener blacklist that would
|
|
228
|
+
* block a {type:'response'} message carrying the same eventId as the original emit.
|
|
229
|
+
*
|
|
227
230
|
* @param payload - The main panel action payload containing plugin_id, action_key, and action parameters
|
|
228
231
|
*/
|
|
229
232
|
triggerOnMainPanelAction: (payload: MainPanelAction) => Promise<void>;
|
|
@@ -175,25 +175,27 @@ class RimoriTestEnvironment {
|
|
|
175
175
|
},
|
|
176
176
|
/**
|
|
177
177
|
* Triggers a main panel action event as the parent application would.
|
|
178
|
-
* This simulates how rimori-main
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
178
|
+
* This simulates how rimori-main sends the MainPanelAction back to the plugin after
|
|
179
|
+
* the plugin calls onMainPanelAction() and emits '{pluginId}.action.requestMain'.
|
|
180
|
+
*
|
|
181
|
+
* We listen for that outbound emit and respond by injecting a fresh event with
|
|
182
|
+
* sender='rimori-main'. This avoids the EventBus per-listener blacklist that would
|
|
183
|
+
* block a {type:'response'} message carrying the same eventId as the original emit.
|
|
184
|
+
*
|
|
182
185
|
* @param payload - The main panel action payload containing plugin_id, action_key, and action parameters
|
|
183
186
|
*/
|
|
184
187
|
triggerOnMainPanelAction: async (payload) => {
|
|
185
188
|
if (!this.messageChannelSimulator) {
|
|
186
189
|
throw new Error('MessageChannelSimulator not initialized. Call setup() first.');
|
|
187
190
|
}
|
|
188
|
-
// Listen for when the plugin emits 'action.requestMain' (which becomes '{pluginId}.action.requestMain')
|
|
189
|
-
// and respond with the MainPanelAction payload, matching rimori-main's EventBus.respond behavior
|
|
190
191
|
const topic = `${this.pluginId}.action.requestMain`;
|
|
191
|
-
// Store the payload in a closure so we can respond with it
|
|
192
192
|
const actionPayload = payload;
|
|
193
|
-
//
|
|
194
|
-
//
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
// When the plugin emits action.requestMain, immediately emit back the action data
|
|
194
|
+
// as a fresh event from 'rimori-main' (different sender bypasses the EventBus blacklist).
|
|
195
|
+
const off = this.messageChannelSimulator.on(topic, async () => {
|
|
196
|
+
await this.messageChannelSimulator.emit(topic, actionPayload, 'rimori-main');
|
|
197
|
+
off();
|
|
198
|
+
});
|
|
197
199
|
},
|
|
198
200
|
};
|
|
199
201
|
this.ai = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rimori/playwright-testing",
|
|
3
|
-
"version": "0.3.21-next.
|
|
3
|
+
"version": "0.3.21-next.1",
|
|
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": "
|
|
29
|
+
"@rimori/client": "2.5.32-next.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@playwright/test": "^1.40.0",
|
|
33
|
-
"@rimori/client": "
|
|
33
|
+
"@rimori/client": "2.5.32-next.2",
|
|
34
34
|
"@types/node": "^20.12.7",
|
|
35
35
|
"rimraf": "^5.0.7",
|
|
36
36
|
"typescript": "^5.7.2"
|