Class: TestEditorContext
Test-specific extension of EditorContext that includes testing utilities. This class should only be used in test environments and not in production code.
Extends
EditorContext
Constructors
Constructor
new TestEditorContext(context): TestEditorContext;
Parameters
Parameter
Type
contextActionContextReturns
TestEditorContext
Inherited from
EditorContext.constructor
Properties
Property
Modifier
Type
Inherited from
contextpublicActionContextEditorContext.contextMethods
sendCustomMessage()
sendCustomMessage(data): void;
Sends a message to the SDK Agent to update the state of current running workflow.
Parameters
Parameter
Type
Description
dataunknownincoming data coming from client to update the workflow. Note - Type of data is limited to what postMessage supports.
Returns
void
Inherited from
EditorContext.sendCustomMessage
showToast()
showToast(message, options?): Promise<void>;
This method is for testing purposes only and should not be used in production. This is a demo usecase to shows a toast message by sending a custom message to the agent side. The agent will handle displaying the toast.
Parameters
Parameter
Type
Description
messagestringThe message to display in the toast
options?{
duration?: number; type?: "error" | "success" | "info" | "warning"; }Optional toast configuration
options.duration?number-
options.type?"error" | "success" | "info" | "warning"-
Returns
Promise< void >
Promise that resolves when the toast is displayed