22 buildCollectionUsageKey ,
33 ContainerType ,
44 getBlockType ,
5- getBlockTypeBlockV1 ,
65 getLibraryId ,
76 isLibraryKey ,
87 isLibraryV1Key ,
@@ -19,13 +18,19 @@ describe('component utils', () => {
1918 [ 'lct:org:lib:unit:my-unit-9284e2' , 'unit' ] ,
2019 [ 'lct:org:lib:section:my-section-9284e2' , 'section' ] ,
2120 [ 'lct:org:lib:subsection:my-section-9284e2' , 'subsection' ] ,
21+ [ 'block-v1:org+type@html+block@1' , 'html' ] ,
22+ [ 'block-v1:OpenCraftX+type@html+block@1571fe018-f3ce-45c9-8f53-5dafcb422fdd' , 'html' ] ,
23+ [ 'block-v1:Axim+type@problem+block@571fe018-f3ce-45c9-8f53-5dafcb422fdd' , 'problem' ] ,
24+ [ 'block-v1:org+type@unit+block@1' , 'unit' ] ,
25+ [ 'block-v1:org+type@section+block@1' , 'section' ] ,
26+ [ 'block-v1:org+type@subsection+block@1' , 'subsection' ] ,
2227 ] ) {
2328 it ( `returns '${ expected } ' for usage key '${ input } '` , ( ) => {
2429 expect ( getBlockType ( input ) ) . toStrictEqual ( expected ) ;
2530 } ) ;
2631 }
2732
28- for ( const input of [ '' , undefined , null , 'not a key' , 'lb:foo' ] ) {
33+ for ( const input of [ '' , undefined , null , 'not a key' , 'lb:foo' , 'block-v1:foo' ] ) {
2934 it ( `throws an exception for usage key '${ input } '` , ( ) => {
3035 expect ( ( ) => getBlockType ( input as any ) ) . toThrow ( `Invalid usageKey: ${ input } ` ) ;
3136 } ) ;
@@ -143,25 +148,4 @@ describe('component utils', () => {
143148 } ) ;
144149 }
145150 } ) ;
146-
147- describe ( 'getBlockTypeBlockV1' , ( ) => {
148- for ( const [ input , expected ] of [
149- [ 'block-v1:org+type@html+block@1' , 'html' ] ,
150- [ 'block-v1:OpenCraftX+type@html+block@1571fe018-f3ce-45c9-8f53-5dafcb422fdd' , 'html' ] ,
151- [ 'block-v1:Axim+type@problem+block@571fe018-f3ce-45c9-8f53-5dafcb422fdd' , 'problem' ] ,
152- [ 'block-v1:org+type@unit+block@1' , 'unit' ] ,
153- [ 'block-v1:org+type@section+block@1' , 'section' ] ,
154- [ 'block-v1:org+type@subsection+block@1' , 'subsection' ] ,
155- ] ) {
156- it ( `returns '${ expected } ' for usage key '${ input } '` , ( ) => {
157- expect ( getBlockTypeBlockV1 ( input ) ) . toStrictEqual ( expected ) ;
158- } ) ;
159- }
160-
161- for ( const input of [ '' , undefined , null , 'not a key' , 'block-v1:foo' ] ) {
162- it ( `throws an exception for usage key '${ input } '` , ( ) => {
163- expect ( ( ) => getBlockTypeBlockV1 ( input as any ) ) . toThrow ( `Invalid usageKey: ${ input } ` ) ;
164- } ) ;
165- }
166- } ) ;
167151} ) ;
0 commit comments