Skip to main content
Renders a component against the mock bridge, so a widget, tab, page, row action or settings panel is testable outside Tappify.

Parameters

ui

ReactElement

options?

RenderWithTapOptions = {}

Returns

RenderWithTapResult

Remarks

It builds a mock from the same options createTapMock takes unless you pass mock, wraps the component in the host provider and a QueryClient that does not retry and does not cache between tests, and appends the mock’s portal to the rendered document so TapDialog has somewhere to go. It rewires tap.invalidate onto that client, so a component calling it drops the right cache entries. Scopes default to all of them, so pass scopes to cover the refused path; a handler has to be built with jwks: await testJwks() and the same extensionId the mock reports. Load @tappify/extension-sdk/testing/vitest or .../testing/jest as a setup file first: that installs the host CSS variables, registers the matchers and clears the portal between tests.

Example