Don't use a default value in BooleanComponent
(#3822)
This commit is contained in:
parent
c3b08cd601
commit
2f8980d09a
2 changed files with 9 additions and 4 deletions
|
@ -142,32 +142,38 @@ describe("Realm settings events tab tests", () => {
|
||||||
|
|
||||||
cy.findByTestId("option-aes-generated").click();
|
cy.findByTestId("option-aes-generated").click();
|
||||||
realmSettingsPage.enterConsoleDisplayName("test_aes-generated");
|
realmSettingsPage.enterConsoleDisplayName("test_aes-generated");
|
||||||
|
realmSettingsPage.toggleSwitch("active", false);
|
||||||
|
realmSettingsPage.toggleSwitch("enabled", false);
|
||||||
realmSettingsPage.addProvider();
|
realmSettingsPage.addProvider();
|
||||||
|
|
||||||
realmSettingsPage.toggleAddProviderDropdown();
|
realmSettingsPage.toggleAddProviderDropdown();
|
||||||
|
|
||||||
cy.findByTestId("option-ecdsa-generated").click();
|
cy.findByTestId("option-ecdsa-generated").click();
|
||||||
realmSettingsPage.enterConsoleDisplayName("test_ecdsa-generated");
|
realmSettingsPage.enterConsoleDisplayName("test_ecdsa-generated");
|
||||||
realmSettingsPage.toggleSwitch("active", false);
|
realmSettingsPage.toggleSwitch("enabled", false);
|
||||||
realmSettingsPage.addProvider();
|
realmSettingsPage.addProvider();
|
||||||
|
|
||||||
realmSettingsPage.toggleAddProviderDropdown();
|
realmSettingsPage.toggleAddProviderDropdown();
|
||||||
|
|
||||||
cy.findByTestId("option-hmac-generated").click();
|
cy.findByTestId("option-hmac-generated").click();
|
||||||
realmSettingsPage.enterConsoleDisplayName("test_hmac-generated");
|
realmSettingsPage.enterConsoleDisplayName("test_hmac-generated");
|
||||||
realmSettingsPage.toggleSwitch("enabled", false);
|
realmSettingsPage.toggleSwitch("active", false);
|
||||||
realmSettingsPage.addProvider();
|
realmSettingsPage.addProvider();
|
||||||
|
|
||||||
realmSettingsPage.toggleAddProviderDropdown();
|
realmSettingsPage.toggleAddProviderDropdown();
|
||||||
|
|
||||||
cy.findByTestId("option-rsa-generated").click();
|
cy.findByTestId("option-rsa-generated").click();
|
||||||
realmSettingsPage.enterConsoleDisplayName("test_rsa-generated");
|
realmSettingsPage.enterConsoleDisplayName("test_rsa-generated");
|
||||||
|
realmSettingsPage.toggleSwitch("active", false);
|
||||||
|
realmSettingsPage.toggleSwitch("enabled", false);
|
||||||
realmSettingsPage.addProvider();
|
realmSettingsPage.addProvider();
|
||||||
|
|
||||||
realmSettingsPage.toggleAddProviderDropdown();
|
realmSettingsPage.toggleAddProviderDropdown();
|
||||||
|
|
||||||
cy.findByTestId("option-rsa-enc-generated").click();
|
cy.findByTestId("option-rsa-enc-generated").click();
|
||||||
realmSettingsPage.enterConsoleDisplayName("test_rsa-enc-generated");
|
realmSettingsPage.enterConsoleDisplayName("test_rsa-enc-generated");
|
||||||
|
realmSettingsPage.toggleSwitch("active", false);
|
||||||
|
realmSettingsPage.toggleSwitch("enabled", false);
|
||||||
realmSettingsPage.addProvider();
|
realmSettingsPage.addProvider();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ export const BooleanComponent = ({
|
||||||
name,
|
name,
|
||||||
label,
|
label,
|
||||||
helpText,
|
helpText,
|
||||||
defaultValue,
|
|
||||||
isDisabled = false,
|
isDisabled = false,
|
||||||
}: ComponentProps) => {
|
}: ComponentProps) => {
|
||||||
const { t } = useTranslation("dynamic");
|
const { t } = useTranslation("dynamic");
|
||||||
|
@ -28,7 +27,7 @@ export const BooleanComponent = ({
|
||||||
<Controller
|
<Controller
|
||||||
name={convertToName(name!)}
|
name={convertToName(name!)}
|
||||||
data-testid={name}
|
data-testid={name}
|
||||||
defaultValue={defaultValue || false}
|
defaultValue={false}
|
||||||
control={control}
|
control={control}
|
||||||
render={({ onChange, value }) => (
|
render={({ onChange, value }) => (
|
||||||
<Switch
|
<Switch
|
||||||
|
|
Loading…
Reference in a new issue