@@ -15,6 +15,29 @@ const assertNormalizedUrlParams = <UrlParams extends Schema.Schema.Any>(
1515describe ( "HttpApiBuilder" , ( ) => {
1616 describe ( "normalizeUrlParams" , ( ) => {
1717 describe ( "Property Signatures" , ( ) => {
18+ it ( "Enums" , ( ) => {
19+ enum Fruits {
20+ A = "a" ,
21+ B = "b"
22+ }
23+
24+ const schema = Schema . Struct ( {
25+ a : Schema . Enums ( Fruits )
26+ } )
27+ assertNormalizedUrlParams ( schema , { a : "a" } , { a : "a" } )
28+ assertNormalizedUrlParams ( schema , { a : "b" } , { a : "b" } )
29+ assertNormalizedUrlParams ( schema , { a : [ "a" ] } , { a : [ "a" ] } )
30+ assertNormalizedUrlParams ( schema , { a : [ "b" ] } , { a : [ "b" ] } )
31+ } )
32+
33+ it ( "TemplateLiteral" , ( ) => {
34+ const schema = Schema . Struct ( {
35+ a : Schema . TemplateLiteral ( "a" , Schema . String )
36+ } )
37+ assertNormalizedUrlParams ( schema , { a : "a" } , { a : "a" } )
38+ assertNormalizedUrlParams ( schema , { a : [ "a" ] } , { a : [ "a" ] } )
39+ } )
40+
1841 it ( "String" , ( ) => {
1942 const schema = Schema . Struct ( { a : Schema . String } )
2043 assertNormalizedUrlParams ( schema , { a : "a" } , { a : "a" } )
@@ -102,6 +125,28 @@ describe("HttpApiBuilder", () => {
102125 } )
103126
104127 describe ( "Index Signatures" , ( ) => {
128+ it ( "Enums" , ( ) => {
129+ enum Fruits {
130+ A = "a" ,
131+ B = "b"
132+ }
133+
134+ const schema = Schema . Record ( {
135+ key : Schema . String ,
136+ value : Schema . Enums ( Fruits )
137+ } )
138+ assertNormalizedUrlParams ( schema , { a : "a" } , { a : "a" } )
139+ assertNormalizedUrlParams ( schema , { a : "b" } , { a : "b" } )
140+ } )
141+
142+ it ( "TemplateLiteral" , ( ) => {
143+ const schema = Schema . Record ( {
144+ key : Schema . String ,
145+ value : Schema . TemplateLiteral ( "a" , Schema . String )
146+ } )
147+ assertNormalizedUrlParams ( schema , { a : "a" } , { a : "a" } )
148+ } )
149+
105150 it ( "String" , ( ) => {
106151 const schema = Schema . Record ( {
107152 key : Schema . String ,
0 commit comments