cljs-tlr.core

ClojureScript wrapper for @testing-library/react.

This namespace re-exports the most commonly used functions from the library’s sub-namespaces for convenient single-require usage.

For full functionality, require individual namespaces:

Example usage:

(ns my-app.component-test
  (:require
   [cljs.test :as t :include-macros true]
   [cljs-tlr.core :as tlr]
   [cljs-tlr.fixtures :as fixtures]
   [uix.core :refer [$ defui]]))

(t/use-fixtures :each fixtures/cleanup-fixture)

(t/deftest my-component-test
  (tlr/render ($ my-component {:name "test"}))
  (t/is (some? (tlr/get-by-text "Hello, test"))))

act

cleanup-fixture

clear

click

configure!

dbl-click

debug

find-by-label-text

find-by-role

find-by-text

get-all-by-role

get-all-by-text

get-by-display-value

get-by-label-text

get-by-placeholder-text

get-by-role

get-by-test-id

get-by-text

hover

keyboard

query-by-display-value

query-by-label-text

query-by-placeholder-text

query-by-role

query-by-test-id

query-by-text

render

render-hook

rerender

select-options

setup

tab

type-text

unmount

wait-for

wait-for-element-to-be-removed