diff --git a/x-pack/plugins/session_view/common/utils/expand_dotted_object.test.ts b/x-pack/plugins/session_view/common/utils/expand_dotted_object.test.ts index 7a1afe8f5b6e4..f876ad6eab31e 100644 --- a/x-pack/plugins/session_view/common/utils/expand_dotted_object.test.ts +++ b/x-pack/plugins/session_view/common/utils/expand_dotted_object.test.ts @@ -21,13 +21,21 @@ const testFlattenedObj = { emptyArray: [], }; describe('expandDottedObject(obj)', () => { - it('works', () => { + it('retrieves values from flattened keys', () => { const expanded: any = expandDottedObject(testFlattenedObj); expect(expanded.flattened.property.a).toEqual('valueA'); expect(expanded.flattened.property.b).toEqual('valueB'); - expect(expanded.regularProp.nestedProp).toEqual('nestedValue'); + }); + it('retrieves values from nested keys', () => { + const expanded: any = expandDottedObject(testFlattenedObj); + expect(Array.isArray(expanded.nested.array)).toBeTruthy(); expect(expanded.nested.array[0].arrayProp).toEqual('arrayValue'); }); + it('doesn\'t break regular value access', () => { + const expanded: any = expandDottedObject(testFlattenedObj); + + expect(expanded.regularProp.nestedProp).toEqual('nestedValue'); + }); });