interface MockTypedView<TState, TClient, TKind extends string = string> The typed mock of one generated client, created by a generated mock{Name}().
Properties
route
readonly route: string; The route, such as editor for a root View or content1 for content.
reference
readonly reference: MockReference<TKind>; Put this in a parent mock's state to present this View as content.
state
readonly state: TState; No documentation.
revision
readonly revision: number; No documentation.
Methods
update
update(patch: Patch<TState> | ((state: TState) => Patch<TState>)): void; Merges state changes and publishes them, like a producer: one frame with the members that changed.
failNext
failNext<M extends MockMethodName<TClient>>(method: M, failure: MockErrorFailure | MockDomainFailure<MockFailureOf<TClient[M]>>, times?: number): void; Answers the next times calls of a client method with failure: an unexpected failure, or the method's declared failure as { kind: "domain-failed", failure }.
pushFailure
pushFailure(failure: {
readonly kind?: BridgeErrorKind;
readonly message: string;
readonly detail?: BridgeFailureDetail;
}): void; Pushes a failure notice; the client keeps its last state and reports the error.
batch
batch(edit: () => void): void; Publishes the collection edits and updates made by edit as one frame.
renew
renew(): void; Begins a new presentation epoch (presentation-epoch/1), as RunicPresentation.Renew does: scoped commands the page issued for the earlier one answer superseded. See MockView.renew.
waitPresented
waitPresented(timeout?: number): Promise<boolean>; Asks the page to report that it painted this View (presented/1). See MockView.waitPresented.