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
@@ -211,7 +211,7 @@ test.describe("Room list custom sections", () => {
// Change the name and confirm
await dialog.getByRole("textbox", { name: "Section name" }).fill("Personal");
await dialog.getByRole("button", { name: "Edit section" }).click();
await dialog.getByRole("button", { name: "Save" }).click();
// Dialog should close
await expect(dialog).not.toBeVisible();
@@ -69,9 +69,7 @@ export function CreateSectionDialog({ onFinished, sectionToEdit }: CreateSection
</Form.Root>
</Flex>
<DialogButtons
primaryButton={
isEdition ? _t("create_section_dialog|edit_section") : _t("create_section_dialog|create_section")
}
primaryButton={isEdition ? _t("common|save") : _t("create_section_dialog|create_section")}
primaryDisabled={isInvalid}
hasCancel={true}
onCancel={() => onFinished(false, "")}
-1
View File
@@ -677,7 +677,6 @@
"create_section_dialog": {
"create_section": "Create section",
"description": "Sections are only for you",
"edit_section": "Edit section",
"label": "Section name",
"title": "Create a section",
"title_edition": "Edit a section"
@@ -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();
});
});
});