widget_services_visibility_mock
Allows to instantiate a mock implementations of AxVisibility
, compatible to the "axVisibility"
widet service injection.
Contents
Module Members
Types
Module Members
create( context )
Creates a mock for the widget-specific "axVisibility" injection.
Parameters
Property | Type | Description |
---|---|---|
context | AxContext |
an object with an eventBus and a widget.area . |
Returns
Type | Description |
---|---|
AxVisibilityMock |
an axVisibility -compatible mock object |
Types
AxVisibilityMock
extends
AxMock
A mock version of AxVisibility
, the widget-specific "axVisibility" injection.
The mock:
- spies on the regular methods,
- turns the update-methods into no-ops (but you can still inspect their spies),
- offers additional
mockShow
andmockHide
methods, which internally use the context (mock) event bus to allow testing features that involvetrack/onShow/onHide/onChange/unsubscribe
. If the (mock) event bus has a flush method, usingmockShow
andmockHide
will automatically flush.
AxVisibilityMock.mockShow()
Simulates the widget's containing area becoming visible. Flushes the underlying event bus mock as a side-effect.
AxVisibilityMock.mockHide()
Simulates the widget's containing area becoming hidden. Flushes the underlying event bus mock as a side-effect.