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. TestCase.expectOutputAsync().
Constructor
- constructor()Creates a new managed object.
Instance Members
- schedule(f, lowPriority?)Schedules the provided callback in the rendering queue.
- getRenderCallback()Returns a global render callback, which adds new output to the root element.
- tryFocusElement(element?)Attempts to set input focus to the specified element in the background.
- transform(output)Transforms or animates the provided output element (not supported in test renderer).
- createObserver(target)Attaches a renderer to the the provided UI component (called internally).
- clear()Clears all existing output.
- remount()Re-mounts mounted content (not supported in test renderer, but does emit a change event).
- hasOutput()Returns true if any output is currently rendered at all.
- expectOutput(…select)Creates an assertion for the currently rendered output with the provided (optional) selection filter(s).
- expectOutputAsync(timeout, …select)Waits for output to be rendered, that matches the provided selection filter(s).
- expectMessageDialogAsync(timeout, …match)Waits for an alert or confirmation dialog to be rendered, that contains the provided label(s).
- getOutputDump(…select)Returns an object representation of (selected) output.
Inherited Members
- animateAsync(out, transformer)Uses the provided output transformer to animate a rendered view.
- emit(event)Emits an event, immediately calling all event handlers.
- emitChange(name?, data?)Emits a change event, an instance of ManagedChangeEvent.
- listen(handler)Adds a handler for all events emitted by this object.
- isUnlinked()Returns true if the object has been unlinked.
- unlink()Unlinks this managed object.
- beforeUnlink() protectedA method that’s called immediately before unlinking an object, can be overridden.
- attach(target, observer?) protectedAttaches the provided managed object to this object.
- autoAttach(propertyName, observer?) protectedObserves a property, so that any object assigned to it is attached immediately.