Components (.cljc + .css + tests): - Alert (success/warning/danger/info variants) - Badge (primary/secondary/outline/success/warning/danger) - Card (card/card-header/card-body/card-footer) - Accordion (collapsible with open/closed state) - Table (headers/rows, striped/bordered variants) - Dialog (modal with header/body/footer sections) - Breadcrumb (nav with active item) - Pagination (current/total with prev/next) - Progress (value bar with color variants) - Spinner (sm/md/lg sizes) - Skeleton (line/box/circle/heading placeholders) - Switch (toggle with checked/disabled states) - Tooltip (hover text via data-tooltip attr) CSS-only additions: - Form elements (inputs, selects, checkboxes, radios, range, groups) - Grid (12-column system with offsets, responsive) - Utilities (flex, spacing, alignment, sr-only) Also adds warning/fg-on-warning tokens to light and dark themes. All 3 dev targets updated with full component showcase. 40 tests, 213 assertions, all passing.
16 lines
614 B
Clojure
16 lines
614 B
Clojure
(ns ui.tooltip-test
|
|
(:require [clojure.test :refer [deftest is testing]]
|
|
[ui.tooltip :as tooltip]))
|
|
|
|
(deftest tooltip-component-test
|
|
(testing "renders a span with data-tooltip attr"
|
|
(let [result (tooltip/tooltip {:text "Hello"} "Hover me")]
|
|
(is (= :span (first result)))
|
|
(is (= "tooltip" (get-in result [1 :class])))
|
|
(is (= "Hello" (get-in result [1 :data-tooltip])))
|
|
(is (= "Hover me" (nth result 2)))))
|
|
|
|
(testing "extra class appended"
|
|
(let [result (tooltip/tooltip {:text "Tip" :class "extra"} "X")]
|
|
(is (= "tooltip extra" (get-in result [1 :class]))))))
|