Room list: change Edit section label to Save in edit section dialog (#34364)

* Change `Edit section` label to `Save` in edit section dialog

* Update e2e tests
This commit is contained in:
Florian Duros
2026-07-21 15:39:42 +00:00
committed by GitHub
parent c80d39a182
commit 363ef74248
4 changed files with 8 additions and 11 deletions
@@ -68,26 +68,26 @@ describe("CreateSectionDialog", () => {
expect(input).toHaveValue("Existing Section");
});
it("shows the edit section button instead of create section", () => {
it("shows the save button instead of create section", () => {
renderEditComponent();
expect(screen.getByRole("button", { name: "Edit section" })).toBeInTheDocument();
expect(screen.getByRole("button", { name: "Save" })).toBeInTheDocument();
expect(screen.queryByRole("button", { name: "Create section" })).not.toBeInTheDocument();
});
it("calls onFinished with the updated name when edit section is clicked", async () => {
it("calls onFinished with the updated name when save is clicked", async () => {
renderEditComponent();
const input = screen.getByRole("textbox");
await userEvent.clear(input);
await userEvent.type(input, "Updated Section");
await userEvent.click(screen.getByRole("button", { name: "Edit section" }));
await userEvent.click(screen.getByRole("button", { name: "Save" }));
expect(onFinished).toHaveBeenCalledWith(true, "Updated Section");
});
it("has the edit section button disabled when the input is empty", async () => {
it("has the save button disabled when the input is empty", async () => {
renderEditComponent();
const input = screen.getByRole("textbox");
await userEvent.clear(input);
expect(screen.getByRole("button", { name: "Edit section" })).toBeDisabled();
expect(screen.getByRole("button", { name: "Save" })).toBeDisabled();
});
});
});