diff --git a/app/src/main/java/com/duckduckgo/app/browser/duckchat/DuckChatJSHelper.kt b/app/src/main/java/com/duckduckgo/app/browser/duckchat/DuckChatJSHelper.kt index 679f6e8f9fee..45688117f07a 100644 --- a/app/src/main/java/com/duckduckgo/app/browser/duckchat/DuckChatJSHelper.kt +++ b/app/src/main/java/com/duckduckgo/app/browser/duckchat/DuckChatJSHelper.kt @@ -49,8 +49,8 @@ class RealDuckChatJSHelper @Inject constructor( METHOD_GET_AI_CHAT_NATIVE_HANDOFF_DATA -> id?.let { SendResponseToJs(getAIChatNativeHandoffData(featureName, method, it)) } - METHOD_GET_AI_CHAT_NATIVE_CONFIG -> id?.let { - SendResponseToJs(getAIChatNativeConfig(featureName, method, it)) + METHOD_GET_AI_CHAT_NATIVE_CONFIG_VALUES -> id?.let { + SendResponseToJs(getAIChatNativeConfigValues(featureName, method, it)) } METHOD_OPEN_AI_CHAT -> { val payload = extractPayload(data) @@ -70,7 +70,7 @@ class RealDuckChatJSHelper @Inject constructor( return JsCallbackData(jsonPayload, featureName, method, id) } - private fun getAIChatNativeConfig(featureName: String, method: String, id: String): JsCallbackData { + private fun getAIChatNativeConfigValues(featureName: String, method: String, id: String): JsCallbackData { val jsonPayload = JSONObject().apply { put(PLATFORM, ANDROID) put(IS_HANDOFF_ENABLED, duckChat.isEnabled()) @@ -87,7 +87,7 @@ class RealDuckChatJSHelper @Inject constructor( companion object { const val DUCK_CHAT_FEATURE_NAME = "aiChat" private const val METHOD_GET_AI_CHAT_NATIVE_HANDOFF_DATA = "getAIChatNativeHandoffData" - private const val METHOD_GET_AI_CHAT_NATIVE_CONFIG = "getAIChatNativeConfigValues" + private const val METHOD_GET_AI_CHAT_NATIVE_CONFIG_VALUES = "getAIChatNativeConfigValues" private const val METHOD_OPEN_AI_CHAT = "openAIChat" private const val PAYLOAD = "aiChatPayload" private const val IS_HANDOFF_ENABLED = "isAIChatHandoffEnabled" diff --git a/app/src/test/java/com/duckduckgo/app/browser/duckchat/RealDuckChatJSHelperTest.kt b/app/src/test/java/com/duckduckgo/app/browser/duckchat/RealDuckChatJSHelperTest.kt index c9bcf0873f9f..ecd1f20d0b2f 100644 --- a/app/src/test/java/com/duckduckgo/app/browser/duckchat/RealDuckChatJSHelperTest.kt +++ b/app/src/test/java/com/duckduckgo/app/browser/duckchat/RealDuckChatJSHelperTest.kt @@ -143,9 +143,9 @@ class RealDuckChatJSHelperTest { } @Test - fun whenGetAIChatNativeConfigAndIdIsNullThenReturnNull() = runTest { + fun whenGetAIChatNativeConfigValuesAndIdIsNullThenReturnNull() = runTest { val featureName = "aiChat" - val method = "getAIChatNativeConfig" + val method = "getAIChatNativeConfigValues" val result = testee.processJsCallbackMessage(featureName, method, null, null)