File tree Expand file tree Collapse file tree
main/frontend/components/property
test/frontend/components/property Expand file tree Collapse file tree Original file line number Diff line number Diff line change 674674
675675(defn- add-initial-node-choice
676676 [initial-choices new-choice]
677- (let [node-choice-match? (fn [choice]
678- (let [choice-value (:value choice)
679- new-value (:value new-choice)]
677+ (let [choice-node-value (fn [choice]
678+ (or (:value choice) choice))
679+ node-choice-match? (fn [choice]
680+ (let [choice-value (choice-node-value choice)
681+ new-value (choice-node-value new-choice)]
680682 (or
681683 (and (:db/id choice-value) (= (:db/id choice-value) (:db/id new-value)))
682684 (and (:block/uuid choice-value) (= (:block/uuid choice-value) (:block/uuid new-value)))
Original file line number Diff line number Diff line change 8484 (is (= [existing]
8585 (#'property-value/add-initial-node-choice [existing] duplicate)))))
8686
87+ (deftest add-initial-node-choice-dedupes-existing-raw-entity-test
88+ (let [existing {:db/id 100
89+ :block/uuid #uuid " 11111111-1111-1111-1111-111111111111"
90+ :block/title " Existing node" }
91+ duplicate {:value {:db/id 100
92+ :block/uuid #uuid " 11111111-1111-1111-1111-111111111111" }
93+ :label " Existing node" }]
94+ (is (= [existing]
95+ (#'property-value/add-initial-node-choice [existing] duplicate)))))
96+
8797(deftest add-initial-node-choice-keeps-distinct-node-with-same-label-test
8898 (let [existing {:value {:db/id 100
8999 :block/uuid #uuid " 11111111-1111-1111-1111-111111111111" }
You can’t perform that action at this time.
0 commit comments