@@ -28,13 +28,20 @@ describe('OnyxKeys', () => {
2828 describe ( 'splitCollectionMemberKey' , ( ) => {
2929 describe ( 'should return correct values' , ( ) => {
3030 const dataResult : Record < string , [ string , string ] > = {
31+ // Collection key with no member ID
3132 test_ : [ 'test_' , '' ] ,
33+ // Nested collection key with no member ID
3234 test_level_ : [ 'test_level_' , '' ] ,
35+ // Nested collection keys with member IDs
3336 test_level_1 : [ 'test_level_' , '1' ] ,
3437 test_level_2 : [ 'test_level_' , '2' ] ,
38+ // Deeply nested collection member key, matches longest prefix
3539 test_level_last_3 : [ 'test_level_last_' , '3' ] ,
40+ // Underscores in the ID portion, only the first matching prefix is the collection key
3641 test___FAKE__ : [ 'test_' , '__FAKE__' ] ,
42+ // Negative/compound IDs, the collection is 'test_', everything after is the ID
3743 'test_-1_something' : [ 'test_' , '-1_something' ] ,
44+ // Nested collection with compound ID, 'test_level_' is the longest matching collection
3845 'test_level_-1_something' : [ 'test_level_' , '-1_something' ] ,
3946 } ;
4047
0 commit comments