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.
25 lines
1.1 KiB
Clojure
25 lines
1.1 KiB
Clojure
(ns ui.progress-test
|
|
(:require [clojure.test :refer [deftest is testing]]
|
|
[ui.progress :as progress]))
|
|
|
|
(deftest progress-bar-class-list-test
|
|
(testing "default (no variant)"
|
|
(is (= ["progress-bar"] (progress/progress-bar-class-list {}))))
|
|
|
|
(testing "explicit variants"
|
|
(is (= ["progress-bar" "progress-bar--success"] (progress/progress-bar-class-list {:variant :success})))
|
|
(is (= ["progress-bar" "progress-bar--warning"] (progress/progress-bar-class-list {:variant :warning})))
|
|
(is (= ["progress-bar" "progress-bar--danger"] (progress/progress-bar-class-list {:variant :danger})))))
|
|
|
|
(deftest progress-component-test
|
|
(testing "renders progress with correct structure"
|
|
(let [result (progress/progress {:value 60})]
|
|
(is (= :div (first result)))
|
|
(is (= "progress" (get-in result [1 :class])))
|
|
(is (= "progressbar" (get-in result [1 :role])))
|
|
;; inner bar
|
|
(let [bar (nth result 2)]
|
|
(is (= :div (first bar)))
|
|
(is (= "progress-bar" (get-in bar [1 :class])))
|
|
(is (= "width: 60%" (get-in bar [1 :style])))))))
|