From 2d096574ff15fae5c007f2bd362e7b93209ff2d4 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Wed, 27 Sep 2023 15:33:31 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Add=20tests=20and=20changelog=20?= =?UTF-8?q?entry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 12 +++++++++++- test/lambdaisland/ornament_test.cljc | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16bf040..00a9500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -78,4 +88,4 @@ ## Added -- Initial implementation \ No newline at end of file +- Initial implementation diff --git a/test/lambdaisland/ornament_test.cljc b/test/lambdaisland/ornament_test.cljc index 3800365..8e2b04f 100644 --- a/test/lambdaisland/ornament_test.cljc +++ b/test/lambdaisland/ornament_test.cljc @@ -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)