From 2bc1570adc310a0ea81c12cf5b5fbd10961374f8 Mon Sep 17 00:00:00 2001 From: Roshan Ghojoghi Date: Sat, 11 Nov 2023 15:24:10 +0300 Subject: [PATCH] enhance: parseYaml tests --- .../monaco-editor/otelCollectorConfigValidation.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/otelbin/src/components/monaco-editor/otelCollectorConfigValidation.test.ts b/packages/otelbin/src/components/monaco-editor/otelCollectorConfigValidation.test.ts index 83d2cb02..dd0e85ea 100644 --- a/packages/otelbin/src/components/monaco-editor/otelCollectorConfigValidation.test.ts +++ b/packages/otelbin/src/components/monaco-editor/otelCollectorConfigValidation.test.ts @@ -228,4 +228,12 @@ describe("findErrorElement", () => { expect(result).toEqual(expectedOutput); }); + + it("with both empty parsed yaml doc and empty error path should return undefined", () => { + const result = findErrorElement([], []); + + const expectedOutput = undefined; + + expect(result).toEqual(expectedOutput); + }); });