@@ -80,7 +80,7 @@ describe("Schematic", () => {
8080 expect ( res . authority ) . toEqual ( 5 ) ;
8181 expect ( res . nodes ) . toHaveLength ( 1 ) ;
8282 expect ( res . nodes [ 0 ] . key ) . toEqual ( "n1" ) ;
83- expect ( ( res . props . n1 as Record < string , unknown > ) . variant ) . toEqual ( "valve" ) ;
83+ expect ( res . props . n1 . variant ) . toEqual ( "valve" ) ;
8484 } ) ;
8585 } ) ;
8686
@@ -119,19 +119,13 @@ describe("Schematic", () => {
119119 } ,
120120 } ) ;
121121 const retrieved = await client . schematics . retrieve ( { key : schem . key } ) ;
122- const props = retrieved . props . n1 as Record < string , unknown > ;
122+ const props = retrieved . props . n1 ;
123123 expect ( props . camelCaseKey ) . toEqual ( "value1" ) ;
124124 expect ( props . PascalCaseKey ) . toEqual ( "value2" ) ;
125125 expect ( props . snake_case_key ) . toEqual ( "value3" ) ;
126- expect ( ( props . nested as Record < string , unknown > ) . innerCamelCase ) . toEqual ( 123 ) ;
127- expect (
128- (
129- ( props . nested as Record < string , unknown > ) . InnerPascalCase as Record <
130- string ,
131- unknown
132- >
133- ) . deepKey ,
134- ) . toEqual ( true ) ;
126+ const nested = props . nested as Record < string , unknown > ;
127+ expect ( nested . innerCamelCase ) . toEqual ( 123 ) ;
128+ expect ( ( nested . InnerPascalCase as Record < string , unknown > ) . deepKey ) . toEqual ( true ) ;
135129 } ) ;
136130 } ) ;
137131
@@ -205,7 +199,7 @@ describe("Schematic", () => {
205199 const res = await client . schematics . retrieve ( { key : schem . key } ) ;
206200 expect ( res . nodes ) . toHaveLength ( 1 ) ;
207201 expect ( res . nodes [ 0 ] ) . toMatchObject ( { key : "n1" , position : { x : 1 , y : 2 } } ) ;
208- expect ( ( res . props . n1 as Record < string , unknown > ) . label ) . toBe ( "Pump" ) ;
202+ expect ( res . props . n1 . label ) . toBe ( "Pump" ) ;
209203 } ) ;
210204
211205 test ( "removeNode removes the node and drops its props" , async ( ) => {
@@ -282,7 +276,7 @@ describe("Schematic", () => {
282276 schematic . setProps ( { key : "n1" , props : { label : "Replaced" } } ) ,
283277 ] ) ;
284278 const res = await client . schematics . retrieve ( { key : schem . key } ) ;
285- expect ( ( res . props . n1 as Record < string , unknown > ) . label ) . toBe ( "Replaced" ) ;
279+ expect ( res . props . n1 . label ) . toBe ( "Replaced" ) ;
286280 } ) ;
287281
288282 test ( "setAuthority replaces the authority value" , async ( ) => {
@@ -327,7 +321,7 @@ describe("Schematic", () => {
327321 expect ( res . nodes ) . toHaveLength ( 2 ) ;
328322 expect ( res . edges ) . toHaveLength ( 1 ) ;
329323 expect ( res . authority ) . toBe ( 200 ) ;
330- expect ( ( res . props . pump as Record < string , unknown > ) . label ) . toBe ( "Main Pump" ) ;
324+ expect ( res . props . pump . label ) . toBe ( "Main Pump" ) ;
331325 } ) ;
332326
333327 test ( "converges to the final position after a 30-action drag storm" , async ( ) => {
@@ -380,7 +374,7 @@ describe("Schematic", () => {
380374 } ) ,
381375 ] ) ;
382376 const res = await client . schematics . retrieve ( { key : schem . key } ) ;
383- const props = res . props . n1 as Record < string , unknown > ;
377+ const props = res . props . n1 ;
384378 expect ( props . camelCaseKey ) . toBe ( "v1" ) ;
385379 expect ( props . PascalCaseKey ) . toBe ( "v2" ) ;
386380 expect ( props . snake_case_key ) . toBe ( "v3" ) ;
0 commit comments