If you're not familiar with what component test drivers are, start by reading this article first.
This section will focus on the motivation and the different driver types in the library.
Having a driver helps encapsulate actions, allowing tests to focus on the "what" instead of the "how."
These drivers are confirmed as working in internal tests and can also be used by consumers to interact with the component in their tests.
The library's modern component drivers are written using Unidriver, which supports multiple platforms (for example, @testing-library/react, enzyme, Puppeteer, etc.).
The library still contains legacy drivers per platform. Usually, the main driver file is implemented for JSDOM, while additional files may be needed for other platforms like enzyme.
Every component should have a driver file named Component.uni.driver.ts.
A component may have a private driver to encapsulate actions not intended to be exposed as a testkit. This file is named Component.private.driver.ts. Private drivers are used for actions that must be tested but shouldn't be exposed to consumers.
Driver methods are generally separated into two types - getters and interactions.
Write a getter for (almost) every prop passed, allowing consumers to verify the component's wiring. The driver should return primitive values or nodes, not complex objects.
Props that affect rendering values are returned in their same type:
title: string <=> getTitle(): stringdisabled: boolean <=> isDisabled(): boollength: number <=> getLength(): numberFor props affecting lifecycle or behavior, use a function to explain the behavior:
initiallyOpened: boolean <=> isOpen(): booleanFor arrays, expose methods to receive items and return primitive values:
labels: [string, string] <=> getLabelAt(index: number): stringitems: [{id, value}, {id, value}] <=> getItemIdAt(index: number): number and getItemValueAt(index: number): stringFor node props (render slots), return the node itself:
prefixIcon: node <=> getPrefixIcon(): nodeSeparate use cases into configurations vs. rendering values. Configurations usually aren't exposed to the consumer and may be part of the private driver.
Match function props with corresponding interactive methods:
onClick: function <=> click()For complex interactions, abstract the actions. For example, instead of exposing all necessary methods for dropdown selection, provide a simple abstraction. For example, instead of using multiple methods to achieve a dropdown selection, expose a single method that abstracts the interaction:
data-* HTML attributes to mark and locate elements in the DOM. Use short names for data-hook.isDisabled()), test both states (true and false).This process is automated, so no action is needed from the developer side.
<ComponentName>Testkit function exposed as a public API.dataHook.Last updated: 15 October 2026