diff --git a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Logs_spec.ts b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Logs_spec.ts index 9ad9732ac3..eb7ec2a91a 100644 --- a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Logs_spec.ts +++ b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Logs_spec.ts @@ -1,6 +1,8 @@ const commonlocators = require("../../../../locators/commonlocators.json"); import { ObjectsRegistry } from "../../../../support/Objects/Registry"; +const locator = ObjectsRegistry.CommonLocators; + const { AggregateHelper: agHelper, ApiPage: apiPage, @@ -417,4 +419,31 @@ describe("Debugger logs", function() { debuggerHelper.DoesConsoleLogExist("start: []"); debuggerHelper.DoesConsoleLogExist("end: [0,1,2,3,4]"); }); + + it("6. Bug #19115 - Objects that start with an underscore `_JSObject1` fail to be navigated from the debugger", function() { + const JSOBJECT_WITH_UNNECCESARY_SEMICOLON = `export default { + myFun1: () => { + //write code here + if (1) { + return true;; + }; + } + } + `; + + jsEditor.CreateJSObject(JSOBJECT_WITH_UNNECCESARY_SEMICOLON, { + paste: true, + completeReplace: true, + toRun: false, + shouldCreateNewJSObj: true, + }); + + ee.SelectEntityByName("Page1", "Pages"); + agHelper.GetNClick(".t--debugger"); + agHelper.GetNClick(locator._errorTab); + + debuggerHelper.ClicklogEntityLink(0); + + cy.get(".t--js-action-name-edit-field").should("exist"); + }); }); diff --git a/app/client/cypress/support/Pages/DebuggerHelper.ts b/app/client/cypress/support/Pages/DebuggerHelper.ts index c6e3e776af..4edaa48ae6 100644 --- a/app/client/cypress/support/Pages/DebuggerHelper.ts +++ b/app/client/cypress/support/Pages/DebuggerHelper.ts @@ -21,6 +21,7 @@ export class DebuggerHelper { _tabsContainer: ".t--debugger-tabs-container", _closeButton: ".t--close-debugger", _logMessage: ".t--debugger-log-message", + _logEntityLink: ".t--debugger-log-entity-link", _logState: ".t--debugger-log-state", _errorCount: ".t--debugger-count", _clearLogs: ".t--debugger-clear-logs", @@ -164,6 +165,10 @@ export class DebuggerHelper { this.agHelper.GetNClick(this.locators._debuggerMessage, index); } + ClicklogEntityLink(index?: number) { + this.agHelper.GetNClick(this.locators._logEntityLink, index); + } + AssertContextMenuItemVisible() { this.agHelper.AssertElementVisible(this.locators._contextMenuItem); } diff --git a/app/client/src/components/editorComponents/Debugger/EntityLink.tsx b/app/client/src/components/editorComponents/Debugger/EntityLink.tsx index 61377d1392..037c2f3072 100644 --- a/app/client/src/components/editorComponents/Debugger/EntityLink.tsx +++ b/app/client/src/components/editorComponents/Debugger/EntityLink.tsx @@ -163,7 +163,10 @@ function Link(props: { ? props.name : props.name + "." + props.entityType.toLowerCase(); return ( - + {link} ); diff --git a/app/client/src/sagas/PostLintingSagas.ts b/app/client/src/sagas/PostLintingSagas.ts index ae9f64ee3e..35e0458cf3 100644 --- a/app/client/src/sagas/PostLintingSagas.ts +++ b/app/client/src/sagas/PostLintingSagas.ts @@ -50,7 +50,7 @@ export function* logLatestLintPropertyErrors({ text: createMessage(JS_OBJECT_BODY_INVALID), messages: lintErrorMessagesInPath, source: { - id: path, + id: entity.actionId, name: entityName, type: ENTITY_TYPE.JSACTION, propertyPath, @@ -58,6 +58,7 @@ export function* logLatestLintPropertyErrors({ }, }); } + AppsmithConsole.addErrors(errorsToAdd); AppsmithConsole.deleteErrors(errorsToRemove); }