Methods
(static) createMockBridge(bridgeClassOrObject, initialDataopt) → {object}
Creates a mock bridge proxy.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
bridgeClassOrObject |
function | object | The bridge class or object to mock. |
|
initialData |
object |
<optional> |
Initial state override. |
- Source:
Returns:
The mock bridge proxy.
- Type
- object
(static) createMockRouter(optionsopt) → {object}
Creates a lightweight mock router for isolated page / route-dependent tests.
Attaches itself to window.__avenx_routers so component $route works.
Parameters:
- Source:
Returns:
Mock router with push, replace, getParams, and currentRoute.
- Type
- object
(static) createSandbox() → {AvenxSandbox}
Creates a new testing sandbox.
- Source:
Returns:
- Type
- AvenxSandbox
(static) fireEvent(element, eventType, detailopt) → {Promise:.<void:>}
Helper to dispatch DOM events synchronously and flush scheduler microtasks.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
element |
Element | ||
eventType |
string | ||
detail |
object |
<optional> |
- Source:
Returns:
(static) flushPromises() → {Promise:.<void:>}
Waits for pending Promise microtasks / macrotasks to settle.
- Source:
Returns:
(static) mountTestComponent(ComponentClass, optionsopt) → {Promise:.<object:>}
Instantiates, mounts, and returns component instance with mocked props, slots, and state.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
ComponentClass |
function | ||
options |
object |
<optional> |
- Source:
Returns:
(static) trigger(element, eventName, eventDataopt)
Triggers an event on an element. Supports standard DOM Event/CustomEvent and custom MockNode trigger method.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
element |
Element | ||
eventName |
string | ||
eventData |
object |
<optional> |
- Source:
(static) triggerEvent(target, eventName, detailOrOptionsopt) → {Event|object}
Triggers a DOM or custom event on an element. Uses native event constructors for common DOM events and CustomEvent for custom component events.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
target |
Element | object | Target element. |
|
eventName |
string | Event name. |
|
detailOrOptions |
object |
<optional> |
Event detail or event options. |
- Source:
Returns:
- Type
- Event | object