Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible_ai_connect_chatbot: use findBy* to find dynamic content #1484

Merged
Changes from all commits
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
5 changes: 3 additions & 2 deletions ansible_ai_connect_chatbot/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import React from "react";
import { beforeEach, expect, test, vi } from "vitest";
import { render } from "vitest-browser-react";
import { MemoryRouter } from "react-router-dom";
import { screen } from "@testing-library/react";
import { App } from "./App";
import { ColorThemeSwitch } from "./ColorThemeSwitch/ColorThemeSwitch";
import { userEvent, page } from "@vitest/browser/context";
Expand Down Expand Up @@ -184,12 +185,12 @@ test("ThumbsDown icon test", async () => {

await expect.element(page.getByText("Create variables")).toBeVisible();

const thumbsDownIcon = view.getByRole("button", {
const thumbsDownIcon = await screen.findByRole("button", {
name: "Bad response",
});
await thumbsDownIcon.click();

const sureButton = page.getByText("sure!");
const sureButton = await screen.findByText("Sure!");
await expect.element(sureButton).toBeVisible();
await sureButton.click();

Expand Down
Loading