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.
37 lines
1.2 KiB
Clojure
37 lines
1.2 KiB
Clojure
(ns ui.card-test
|
|
(:require [clojure.test :refer [deftest is testing]]
|
|
[ui.card :as card]))
|
|
|
|
(deftest card-class-list-test
|
|
(testing "always returns card class"
|
|
(is (= ["card"] (card/card-class-list {})))))
|
|
|
|
(deftest card-component-test
|
|
(testing "renders an article"
|
|
(let [result (card/card {} "Content")]
|
|
(is (= :article (first result)))
|
|
(is (= "card" (get-in result [1 :class])))
|
|
(is (= "Content" (nth result 2)))))
|
|
|
|
(testing "extra class gets appended"
|
|
(let [result (card/card {:class "extra"} "X")]
|
|
(is (= "card extra" (get-in result [1 :class]))))))
|
|
|
|
(deftest card-header-test
|
|
(testing "renders header"
|
|
(let [result (card/card-header {} [:h3 "Title"])]
|
|
(is (= :header (first result)))
|
|
(is (= "card-header" (get-in result [1 :class]))))))
|
|
|
|
(deftest card-body-test
|
|
(testing "renders body"
|
|
(let [result (card/card-body {} "Content")]
|
|
(is (= :div (first result)))
|
|
(is (= "card-body" (get-in result [1 :class]))))))
|
|
|
|
(deftest card-footer-test
|
|
(testing "renders footer"
|
|
(let [result (card/card-footer {} "Actions")]
|
|
(is (= :footer (first result)))
|
|
(is (= "card-footer" (get-in result [1 :class]))))))
|