class TestRenderer
A class that represents an in-memory application render context.
class TestRenderer extends RenderContext;
Notes
- This class behaves mostly like a ‘real’ renderer, but only keeps rendered elements in memory. The elements can be queried and validated using e.g. expectOutputAsync().
Instance members
isTestRenderer readonly
Flag for duck typing.modalFactory
The default modal factory.getRenderCallback()
Returns a global render callback, which adds new output to the root element.tryFocusElement()
Attempts to set input focus to the specified element in the background.transform()
Transforms or animates the provided output element (not supported in test renderer).createObserver()
Attaches a renderer to the the provided UI element (called internally).clear()
Clears all existing output.remount()
Re-mounts mounted content (not supported in test renderer, but does emit a change event).setTitle()
Does nothing (required by renderer class).hasOutput()
Returns true if any output is currently rendered at all.expectOutput()
Creates an assertion for the currently rendered output with the provided (optional) selection filter(s).expectOutputAsync()
Waits for output to be rendered, that matches the provided selection filter(s).expectMessageDialogAsync()
Waits for an alert or confirmation dialog to be rendered, that contains the provided text(s).getOutputDump()
Returns an object representation of (selected) output.
Inherited members
render()
Renders a view as root, until the view object is unlinked.emit()
Emits an event, immediately calling all event handlers.emitChange()
Emits a change event.listen()
Adds a handler for all events emitted by this object.listenOnce()
Returns a promise for a single event with the provided name.listenAsync()
Adds a handler for all events emitted by this object, and returns an async iterable.observe()
Observes a property, a bound property from an attached parent, or an observable object.observeAsync()
Observes one or more targets asynchronously, batching or debouncing/throttling updates.attach() protected
Attaches the specified observable object to this object.isUnlinked()
Returns true if the object has been unlinked.unlink()
Unlinks this observable object.beforeUnlink() protected
A method that’s called immediately before unlinking an object, can be overridden.
