diff --git a/src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs b/src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs index d049665cfd..70467c719c 100644 --- a/src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs +++ b/src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs @@ -119,7 +119,7 @@ private void WriteRequestsMetadataConstant(CodeConstant codeElement, LanguageWri } writer.WriteLine($"adapterMethodName: \"{GetSendRequestMethodName(isVoid, isStream, executorMethod.ReturnType.IsCollection, isPrimitive, isEnum)}\","); if (isEnum) - writer.WriteLine($"enumObject: \"{executorMethod.ReturnType.Name.ToFirstCharacterUpperCase()}\","); + writer.WriteLine($"enumObject: {executorMethod.ReturnType.Name.ToFirstCharacterUpperCase()},"); else if (!isVoid) writer.WriteLine($"responseBodyFactory: {GetTypeFactory(isVoid, isStream, executorMethod, writer)},"); var sanitizedRequestBodyContentType = executorMethod.RequestBodyContentType.SanitizeDoubleQuote(); diff --git a/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeConstantWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeConstantWriterTests.cs index 2d228419e9..a8309a6076 100644 --- a/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeConstantWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/TypeScript/CodeConstantWriterTests.cs @@ -209,8 +209,7 @@ public void WritesRequestExecutorForEnum() writer.Write(constant); var result = tw.ToString(); Assert.Contains("sendEnum", result); - Assert.Contains("enumObject:", result); - Assert.Contains(EnumName.ToFirstCharacterUpperCase(), result); + Assert.Contains("enumObject: " + EnumName.ToFirstCharacterUpperCase(), result); AssertExtensions.CurlyBracesAreClosed(result); } [Fact] @@ -237,8 +236,7 @@ public void WritesRequestExecutorForEnumCollection() writer.Write(constant); var result = tw.ToString(); Assert.Contains("sendCollectionOfEnum", result); - Assert.Contains("enumObject:", result); - Assert.Contains(EnumName.ToFirstCharacterUpperCase(), result); + Assert.Contains("enumObject: " + EnumName.ToFirstCharacterUpperCase(), result); AssertExtensions.CurlyBracesAreClosed(result); } [Fact]