Skip to content

Commit

Permalink
fix: jest test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
albinAppsmith committed Jul 10, 2024
1 parent 7755e3a commit 126197d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const BlankState: React.FC = () => {
return (
<EmptyState
buttonClassName="t--add-item"
buttonTestId="t--add-item"
buttonText={createMessage(EDITOR_PANE_TEXTS.js_add_button)}
description={createMessage(EDITOR_PANE_TEXTS.js_blank_state_description)}
icon={"js-square-v3"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const BlankState: React.FC = () => {
return (
<EmptyState
buttonClassName="t--add-item"
buttonTestId="t--add-item"
buttonText={createMessage(EDITOR_PANE_TEXTS.query_add_button)}
description={createMessage(
EDITOR_PANE_TEXTS.query_blank_state_description,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe("IDE URL rendering of Queries", () => {
// Check if run button is visible
getByRole("button", { name: /run/i });
// Check if the Add new button is shown
getByRole("button", { name: "New query / API" });
getByTestId("t--add-item");
});

it("Renders Api routes in Split Screen", async () => {
Expand Down Expand Up @@ -346,7 +346,7 @@ describe("IDE URL rendering of Queries", () => {
// Check if run button is visible
getByRole("button", { name: /run/i });
// Check if the Add new button is shown
getByRole("button", { name: "New query / API" });
getByTestId("t--add-item");
});
it("Renders Postgres routes in Split screen", async () => {
const page = PageFactory.build();
Expand Down Expand Up @@ -537,7 +537,7 @@ describe("IDE URL rendering of Queries", () => {
// Check if run button is visible
getByRole("button", { name: /run/i });
// Check if the Add new button is shown
getByRole("button", { name: "New query / API" });
getByTestId("t--add-item");
});
it("Renders Google Sheets routes in Split screen", async () => {
const page = PageFactory.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const AddAndSearchbar = ({ hasAddPermission, onAddClick, onSearch }: Props) => {
{hasAddPermission ? (
<Button
className="t--add-item !min-w-[24px]"
data-testid="t--add-item"
isIconButton
kind={"secondary"}
onClick={onAddClick}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ interface EmptyStateProps {
buttonText: string;
onClick?: () => void;
buttonClassName?: string;
buttonTestId?: string;
}

const EmptyState = ({
buttonClassName,
buttonTestId,
buttonText,
description,
icon,
Expand Down Expand Up @@ -46,6 +48,7 @@ const EmptyState = ({
{onClick && (
<Button
className={buttonClassName}
data-testid={buttonTestId}
kind={"secondary"}
onClick={onClick}
size={"sm"}
Expand Down

0 comments on commit 126197d

Please sign in to comment.