Skip to content

Commit ec005be

Browse files
authored
Update welcome prompts and related tests (#1741)
Revised the welcome prompts in AnsibleChatbot for clearer titles and messages. Updated App.test.tsx to match the new prompt texts and improved test selectors for accessibility.
1 parent 76504a7 commit ec005be

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

ansible_ai_connect_chatbot/src/AnsibleChatbot/AnsibleChatbot.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,17 @@ export const AnsibleChatbot: React.FunctionComponent = () => {
135135
const welcomePrompts = [
136136
{
137137
title: "Using Ansible Automation Platform",
138-
message: "I have a question about Ansible Automation Platform",
138+
message: "I have a question about using Ansible Automation Platform",
139139
},
140140
{
141-
title: "Containerized Installation",
142-
message: "I want to install AAP using the containerized installer",
141+
title: "Installing Ansible Automation Platform",
142+
message:
143+
"I want to learn more about installing Ansible Automation Platform",
143144
},
144145
{
145-
title: "RPM Installation",
146-
message: "I want to install AAP using the RPM installer",
146+
title: "Operating Ansible Automation Platform",
147+
message:
148+
"I want to learn how to operate and monitor Ansible Automation Platform",
147149
},
148150
].map((prompt) => ({
149151
title: prompt.title,

ansible_ai_connect_chatbot/src/App.test.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -942,19 +942,33 @@ test("Clicking a welcome prompt sends the correct message", async () => {
942942
expect.anything(),
943943
expect.objectContaining({
944944
conversation_id: undefined,
945-
query: "I have a question about Ansible Automation Platform",
945+
query: "I have a question about using Ansible Automation Platform",
946946
}),
947947
expect.anything(),
948948
);
949949
});
950950

951951
test("All welcome prompts are rendered", async () => {
952952
const view = await renderApp();
953+
954+
// Use getByRole to find the welcome prompt buttons by their accessible names
953955
await expect
954-
.element(view.getByText("Using Ansible Automation Platform"))
956+
.element(
957+
view.getByRole("button", { name: "Using Ansible Automation Platform" }),
958+
)
955959
.toBeVisible();
956960
await expect
957-
.element(view.getByText("Containerized Installation"))
961+
.element(
962+
view.getByRole("button", {
963+
name: "Installing Ansible Automation Platform",
964+
}),
965+
)
966+
.toBeVisible();
967+
await expect
968+
.element(
969+
view.getByRole("button", {
970+
name: "Operating Ansible Automation Platform",
971+
}),
972+
)
958973
.toBeVisible();
959-
await expect(view.getByText("RPM Installation")).toBeVisible();
960974
});

0 commit comments

Comments
 (0)