Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { jsEditor } from "../../../../support/Objects/ObjectsCore";

describe(
"To test [Bug]: Action redesign: Focus shifts to another tab when renaming a JSObject #38207",
{ tags: ["@tag.JS"] },
() => {
it("1. Validate that focus does not shift to another tab while renaming JS Object", () => {
// Create first JS file
jsEditor.CreateJSObject(
`export default {
myVar1: [],
myVar2: {},
myFun1 () {
// write code here
// this.myVar1 = [1,2,3]
},
async myFun2 () {
// use async-await or promises
// await storeValue('varName', 'hello world')
}
}`,
{
paste: true,
completeReplace: true,
toRun: false,
shouldCreateNewJSObj: true,
},
);

// Create second JS file
jsEditor.CreateJSObject("", { prettify: false, toRun: false });

// Create third JS file
jsEditor.CreateJSObject("", { prettify: false, toRun: false });
jsEditor.RenameJSObjFromPane("ChangedName");

cy.get(jsEditor.listOfJsObjects).eq(2).contains("ChangedName");
});
},
);
1 change: 1 addition & 0 deletions app/client/cypress/support/Pages/JSEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class JSEditor {
public settingsTriggerLocator = "[data-testid='t--js-settings-trigger']";
public contextMenuTriggerLocator = "[data-testid='t--more-action-trigger']";
public runFunctionSelectLocator = "[data-testid='t--js-function-run']";
public listOfJsObjects = "[data-testid='t--tabs-container']>div>span";

public toolbar = new PluginEditorToolbar(
this.runButtonLocator,
Expand Down