Initial Commit

This commit is contained in:
akko
2024-10-08 11:47:30 +02:00
commit afaef18745
5441 changed files with 8298 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
(ns emptyhead.test.idea.property
(:require [cljs.test :as t :include-macros true]
[emptyhead.idea.crud :as crud]
[emptyhead.idea.property :as prop]
[emptyhead.test.fixtures :as fx]))
(t/use-fixtures :once fx/temporary-state)
(t/use-fixtures :each fx/pre-reset)
(t/deftest properties
(t/testing "Property addition and removal"
(let [idea (crud/have-idea!)]
(prop/register-property! idea [:a :b :c] [:a :d :e])
(t/is (= #{[:a :b :c] [:a :d :e] [:a] [:a :b] [:a :d]}
(prop/properties idea)))
(t/is (prop/has-property? idea [:a :b]))
(t/is (not (prop/has-property? idea [:invalid])))
(t/is (contains? (prop/with-property [:a :d]) idea))
(t/is (not (contains? (prop/with-property [:invalid]) idea)))
(prop/remove-property! idea [:a :b])
(t/is (not (prop/has-property? idea [:a :b :c]))))))