Skip to content

Commit

Permalink
🧪 Add tests and changelog entry
Browse files Browse the repository at this point in the history
  • Loading branch information
oxalorg committed Sep 27, 2023
1 parent 68deda0 commit 2d09657
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Unreleased

## Added

## Fixed

- Fix component resolution inside a set (in a rule of another component) (see tests for example)

## Changed

# 1.11.101 (2023-09-13 / 213279d)

## Fixed
Expand Down Expand Up @@ -78,4 +88,4 @@

## Added

- Initial implementation
- Initial implementation
25 changes: 25 additions & 0 deletions test/lambdaisland/ornament_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,31 @@

(reset! o/registry reg))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Component resolution

(o/defstyled child-1 :div
:bg-red-100
([]
[:p "hello"]))

(o/defstyled child-2 :div
:bg-blue-100
([]
[:p "world"]))

(o/defstyled parent-set :div
[#{child-1 child-2} :bg-green-700]
([]
[:<>
[child-1]
[child-2]]))

#?(:clj
(deftest component-resolution-inside-set
(is (= ".ot__parent_set .ot__child_2,.ot__parent_set .ot__child_1{--gi-bg-opacity:1;background-color:rgba(21,128,61,var(--gi-bg-opacity))}"
(o/css parent-set)))))

(comment
(require 'kaocha.repl)
(kaocha.repl/run)
Expand Down

0 comments on commit 2d09657

Please sign in to comment.