fix: Objects that start with an underscore _JSObject1 fail to be navigated from the debugger (#20020)
## Description fix: Objects that start with an underscore `_JSObject1` fail to be navigated from the debugger Fixes #19115 Media <img width="616" alt="image" src="https://user-images.githubusercontent.com/20187542/214258877-797fc095-e523-486e-8674-b9a06f3cc8f8.png"> ## Type of change - Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? - Cypress ### Test Plan ### Issues raised during DP testing ## Checklist: ### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
This commit is contained in:
parent
bab8e6be8d
commit
923e34fbde
|
|
@ -1,6 +1,8 @@
|
||||||
const commonlocators = require("../../../../locators/commonlocators.json");
|
const commonlocators = require("../../../../locators/commonlocators.json");
|
||||||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
||||||
|
|
||||||
|
const locator = ObjectsRegistry.CommonLocators;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
AggregateHelper: agHelper,
|
AggregateHelper: agHelper,
|
||||||
ApiPage: apiPage,
|
ApiPage: apiPage,
|
||||||
|
|
@ -417,4 +419,31 @@ describe("Debugger logs", function() {
|
||||||
debuggerHelper.DoesConsoleLogExist("start: []");
|
debuggerHelper.DoesConsoleLogExist("start: []");
|
||||||
debuggerHelper.DoesConsoleLogExist("end: [0,1,2,3,4]");
|
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");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ export class DebuggerHelper {
|
||||||
_tabsContainer: ".t--debugger-tabs-container",
|
_tabsContainer: ".t--debugger-tabs-container",
|
||||||
_closeButton: ".t--close-debugger",
|
_closeButton: ".t--close-debugger",
|
||||||
_logMessage: ".t--debugger-log-message",
|
_logMessage: ".t--debugger-log-message",
|
||||||
|
_logEntityLink: ".t--debugger-log-entity-link",
|
||||||
_logState: ".t--debugger-log-state",
|
_logState: ".t--debugger-log-state",
|
||||||
_errorCount: ".t--debugger-count",
|
_errorCount: ".t--debugger-count",
|
||||||
_clearLogs: ".t--debugger-clear-logs",
|
_clearLogs: ".t--debugger-clear-logs",
|
||||||
|
|
@ -164,6 +165,10 @@ export class DebuggerHelper {
|
||||||
this.agHelper.GetNClick(this.locators._debuggerMessage, index);
|
this.agHelper.GetNClick(this.locators._debuggerMessage, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClicklogEntityLink(index?: number) {
|
||||||
|
this.agHelper.GetNClick(this.locators._logEntityLink, index);
|
||||||
|
}
|
||||||
|
|
||||||
AssertContextMenuItemVisible() {
|
AssertContextMenuItemVisible() {
|
||||||
this.agHelper.AssertElementVisible(this.locators._contextMenuItem);
|
this.agHelper.AssertElementVisible(this.locators._contextMenuItem);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,10 @@ function Link(props: {
|
||||||
? props.name
|
? props.name
|
||||||
: props.name + "." + props.entityType.toLowerCase();
|
: props.name + "." + props.entityType.toLowerCase();
|
||||||
return (
|
return (
|
||||||
<span className="debugger-entity-link" onClick={onClick}>
|
<span
|
||||||
|
className="debugger-entity-link t--debugger-log-entity-link"
|
||||||
|
onClick={onClick}
|
||||||
|
>
|
||||||
{link}
|
{link}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export function* logLatestLintPropertyErrors({
|
||||||
text: createMessage(JS_OBJECT_BODY_INVALID),
|
text: createMessage(JS_OBJECT_BODY_INVALID),
|
||||||
messages: lintErrorMessagesInPath,
|
messages: lintErrorMessagesInPath,
|
||||||
source: {
|
source: {
|
||||||
id: path,
|
id: entity.actionId,
|
||||||
name: entityName,
|
name: entityName,
|
||||||
type: ENTITY_TYPE.JSACTION,
|
type: ENTITY_TYPE.JSACTION,
|
||||||
propertyPath,
|
propertyPath,
|
||||||
|
|
@ -58,6 +58,7 @@ export function* logLatestLintPropertyErrors({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
AppsmithConsole.addErrors(errorsToAdd);
|
AppsmithConsole.addErrors(errorsToAdd);
|
||||||
AppsmithConsole.deleteErrors(errorsToRemove);
|
AppsmithConsole.deleteErrors(errorsToRemove);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user