Skip to content

Commit 078347f

Browse files
committed
test: polymorphic property generation in TS
1 parent 203ccea commit 078347f

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

test/aidbox_sdk/generator/typescript_test.clj

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,26 @@
7373
:type "Meta"}))))
7474

7575
(testing "element with choices"
76-
;; TODO
77-
))
76+
(is (= "value?: Reference | number;"
77+
(gen.typescript/generate-property {:name "value",
78+
:choices
79+
[{:name "valueReference"
80+
:base "Observation"
81+
:array false
82+
:required false
83+
:value "Base.ResourceReference"
84+
:type "Reference"
85+
:choice-option true}
86+
{:name "valueInteger"
87+
:base "Observation"
88+
:array false
89+
:required false
90+
:value "int"
91+
:type "integer"
92+
:choice-option true}],
93+
:base "Observation",
94+
:array false,
95+
:required false})))))
7896

7997
(deftest test-generate-class
8098
(testing "base"

0 commit comments

Comments
 (0)