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

refactor(coral): Update copy for topic messages #1589

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ describe("TopicMessages", () => {
queryClient: true,
}
);
screen.getByText("Select offset and Update results.");
screen.getByText(
"To view messages in this topic, select the number of messages you'd like to view and select Fetch messages."
);
});
it("requests and displays all messages when Update results is pressed", async () => {
mockGetTopicMessages.mockResolvedValue(mockGetTopicMessagesResponse);
Expand All @@ -65,7 +67,7 @@ describe("TopicMessages", () => {
);
await userEvent.click(
screen.getByRole("button", {
name: "Consume and display the latest 5 messages from topic test",
name: "Fetch and display the latest 5 messages from topic test",
})
);
await waitFor(() => expect(mockGetTopicMessages).toHaveBeenCalledTimes(1));
Expand Down Expand Up @@ -95,11 +97,11 @@ describe("TopicMessages", () => {
);
await userEvent.click(
screen.getByRole("button", {
name: "Consume and display the latest 5 messages from topic test",
name: "Fetch and display the latest 5 messages from topic test",
})
);
await waitFor(() => {
screen.getByText("This Topic contains no Messages.");
screen.getByText("This Topic contains no messages.");
});
});

Expand Down Expand Up @@ -128,7 +130,7 @@ describe("TopicMessages", () => {
);
await userEvent.click(
screen.getByRole("button", {
name: "Consume and display the latest 25 messages from topic test",
name: "Fetch and display the latest 25 messages from topic test",
})
);
await waitFor(() => {
Expand All @@ -155,7 +157,7 @@ describe("TopicMessages", () => {
await userEvent.click(screen.getByRole("radio", { name: "50" }));
await userEvent.click(
screen.getByRole("button", {
name: "Consume and display the latest 50 messages from topic test",
name: "Fetch and display the latest 50 messages from topic test",
})
);
await waitFor(() => {
Expand Down
11 changes: 6 additions & 5 deletions coral/src/app/features/topics/details/messages/TopicMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ function TopicMessages() {
function getTableContent() {
if (!consumeResult) {
return (
<EmptyState title="Consume Messages">
Select offset and Update results.
<EmptyState title="No messages displayed">
To view messages in this topic, select the number of messages
you&apos;d like to view and select Fetch messages.
</EmptyState>
);
} else if (isNoContentResult(consumeResult)) {
return (
<EmptyState title="No messages">
This Topic contains no Messages.
This Topic contains no messages.
</EmptyState>
);
} else {
Expand Down Expand Up @@ -110,10 +111,10 @@ function TopicMessages() {
onClick={handleUpdateResultClick}
disabled={isConsuming}
loading={isConsuming}
aria-label={`Consume and display the latest ${offset} messages from topic ${topicName}`}
aria-label={`Fetch and display the latest ${offset} messages from topic ${topicName}`}
icon={refreshIcon}
>
Update results
Fetch messages
</Button.Primary>
</Box.Flex>,
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe("TopicMessageOffsetFilter", () => {
disabled={true}
/>
);
within(screen.getByRole("group", { name: "Offset" }))
within(screen.getByRole("group", { name: "Number of messages" }))
.getAllByRole("radio")
.forEach((option) => expect(option).toBeDisabled());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function TopicMessageOffsetFilter({
<RadioButtonGroup
name={"offset"}
value={value}
labelText="Offset"
labelText="Number of messages"
disabled={disabled}
onChange={(value) => onChange(value as Offset)}
>
Expand Down