diff --git a/frontend/src/metabase/core/components/CheckBox/CheckBox.tsx b/frontend/src/metabase/core/components/CheckBox/CheckBox.tsx index cbc3bcb46597c6e17d7106320ce8d1b6e9a95cb7..f899499b6b509ef40b9bb347e8c6e6a9c47f6980 100644 --- a/frontend/src/metabase/core/components/CheckBox/CheckBox.tsx +++ b/frontend/src/metabase/core/components/CheckBox/CheckBox.tsx @@ -37,6 +37,7 @@ function CheckboxTooltip({ const CheckBox = forwardRef<HTMLLabelElement, CheckBoxProps>(function Checkbox( { + name, label, labelEllipsis = false, checked, @@ -74,6 +75,7 @@ const CheckBox = forwardRef<HTMLLabelElement, CheckBoxProps>(function Checkbox( onChange={isControlledCheckBoxInput ? onChange : undefined} onFocus={onFocus} onBlur={onBlur} + id={name} /> <CheckBoxContainer disabled={disabled}> <CheckBoxIconContainer diff --git a/frontend/src/metabase/core/components/CheckBox/types.ts b/frontend/src/metabase/core/components/CheckBox/types.ts index 9f9b092593e186f542c1ce55199da1070a6cc799..64b216856345bf4836b8a8a872857efe81b0505b 100644 --- a/frontend/src/metabase/core/components/CheckBox/types.ts +++ b/frontend/src/metabase/core/components/CheckBox/types.ts @@ -26,6 +26,7 @@ export interface CheckBoxLabelProps { export interface CheckBoxProps extends Omit<HTMLAttributes<HTMLElement>, "onChange" | "onFocus" | "onBlur"> { + name?: string; label?: ReactNode; labelEllipsis?: boolean; checked?: boolean; diff --git a/frontend/test/metabase/scenarios/onboarding/auth/signin.cy.spec.js b/frontend/test/metabase/scenarios/onboarding/auth/signin.cy.spec.js index c16363f93cae1e368e18aaf9a84948adf5de1a3f..07d61b097cd2dd3094e85c51e18476ec8439c6a9 100644 --- a/frontend/test/metabase/scenarios/onboarding/auth/signin.cy.spec.js +++ b/frontend/test/metabase/scenarios/onboarding/auth/signin.cy.spec.js @@ -53,6 +53,16 @@ describe("scenarios > auth > signin", () => { cy.contains(/[a-z ]+, Bob/i); }); + it("should allow toggling of Remember Me", () => { + cy.visit("/auth/login"); + + // default initial state + cy.findByRole("checkbox").should("be.checked"); + + cy.findByLabelText("Remember me").click(); + cy.findByRole("checkbox").should("not.be.checked"); + }); + it("should redirect to a unsaved question after login", () => { cy.signInAsAdmin(); cy.visit("/");