diff --git a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Omnibar_spec.js b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Omnibar_spec.js index 6f3e7e95b7..a719da93e9 100644 --- a/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Omnibar_spec.js +++ b/app/client/cypress/integration/Regression_TestSuite/ClientSideTests/OtherUIFeatures/Omnibar_spec.js @@ -81,35 +81,24 @@ describe("Omnibar functionality test cases", () => { cy.get(omnibar.categoryTitle).eq(1).click(); // create new api, js object and cURL import from omnibar - - cy.get(_.peekOverlay.locators._fileOperation("New JS Object")).should( - "be.visible", - ); - cy.get(_.peekOverlay.locators._fileOperation("New Blank API")).should( - "be.visible", - ); - cy.get(_.peekOverlay.locators._fileOperation("New cURL Import")).should( - "be.visible", - ); - - cy.get(omnibar.createNew).eq(0).click(); + cy.get(omnibar.createNew).contains("New JS Object").click(); cy.wait(1000); cy.wait("@createNewJSCollection"); cy.wait(1000); cy.get(".t--js-action-name-edit-field").type(jsObjectName).wait(1000); + cy.get(omnibar.globalSearch).click({ force: true }); cy.get(omnibar.categoryTitle).eq(1).click(); cy.wait(1000); - - cy.get(omnibar.createNew).eq(1).click(); + cy.get(omnibar.createNew).contains("New Blank API").click(); cy.wait(1000); cy.wait("@createNewApi"); cy.renameWithInPane(apiName); + cy.get(omnibar.globalSearch).click({ force: true }); cy.get(omnibar.categoryTitle).eq(1).click(); - + cy.get(omnibar.createNew).contains("New cURL Import").click(); cy.wait(1000); - cy.get(_.peekOverlay.locators._fileOperation("New cURL Import")).click(); cy.url().should("include", "curl-import?"); cy.get('p:contains("Import from CURL")').should("be.visible"); }); diff --git a/app/client/src/components/editorComponents/GlobalSearch/GlobalSearchHooks.test.ts b/app/client/src/components/editorComponents/GlobalSearch/GlobalSearchHooks.test.ts index 6a22227a48..a5b24a1a5e 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/GlobalSearchHooks.test.ts +++ b/app/client/src/components/editorComponents/GlobalSearch/GlobalSearchHooks.test.ts @@ -1,6 +1,7 @@ import { getFilteredAndSortedFileOperations } from "./GlobalSearchHooks"; import type { Datasource } from "entities/Datasource"; import { SEARCH_ITEM_TYPES } from "./utils"; +import { PERMISSION_TYPE } from "@appsmith/utils/permissionHelpers"; describe("getFilteredAndSortedFileOperations", () => { it("works without any datasources", () => { @@ -83,6 +84,10 @@ describe("getFilteredAndSortedFileOperations", () => { {}, true, true, + [ + PERMISSION_TYPE.CREATE_ACTIONS, + PERMISSION_TYPE.CREATE_DATASOURCE_ACTIONS, + ], ); expect(fileOptions[0]).toEqual( @@ -141,6 +146,10 @@ describe("getFilteredAndSortedFileOperations", () => { { abc: 1, "123": 3 }, true, true, + [ + PERMISSION_TYPE.CREATE_ACTIONS, + PERMISSION_TYPE.CREATE_DATASOURCE_ACTIONS, + ], ); expect(fileOptions[0]).toEqual( @@ -199,6 +208,10 @@ describe("getFilteredAndSortedFileOperations", () => { {}, true, true, + [ + PERMISSION_TYPE.CREATE_ACTIONS, + PERMISSION_TYPE.CREATE_DATASOURCE_ACTIONS, + ], ); expect(fileOptions[0]).toEqual(