Files
metabase/e2e/support/helpers/e2e-command-palette-helpers.js
Kamil Mielnik 5a1d677444 RFC 118. Prettier - arrowParens: “always” (#55807)
* Update .prettierrc
- remove "arrowParens": "avoid" so that it defaults to "always" instead

* Run "yarn prettier"
2025-03-27 09:18:07 +00:00

35 lines
1.1 KiB
JavaScript

export const commandPalette = () => cy.findByTestId("command-palette");
export const openCommandPalette = () => cy.get("body").type("{ctrl+k}{cmd+k}");
export const commandPaletteButton = () =>
cy.findByTestId("app-bar").findByRole("button", { name: /Search/ });
export const closeCommandPalette = () => cy.get("body").type("{esc}");
export const pressPageUp = () => cy.realPress("{pageup}");
export const pressPageDown = () => cy.realPress("{pagedown}");
export const pressHome = () => cy.realPress("{home}");
export const pressEnd = () => cy.realPress("{end}");
export const commandPaletteInput = () =>
cy.findByPlaceholderText("Search for anything or jump somewhere…");
export const commandPaletteSearch = (query, viewAll = true) => {
cy.intercept("GET", "/api/search?q=*").as("paletteSearch");
commandPaletteButton().click();
commandPaletteInput().type(query);
cy.wait("@paletteSearch");
if (viewAll) {
commandPalette()
.findByRole("option", { name: /View and filter/ })
.click();
}
};
export const commandPaletteAction = (name) => cy.findByRole("option", { name });