diff --git a/src/Env.jsx b/src/Env.jsx index 6e70c9a43..b35ea2f09 100644 --- a/src/Env.jsx +++ b/src/Env.jsx @@ -81,7 +81,7 @@ export const EnvVar = ({ id, item, onChange, idx, removeitem, additem, itemCount onChange={(_event, value) => { utils.validationClear(validationFailed, "envValue", onValidationChange); utils.validationDebounce(() => onValidationChange({ ...validationFailed, envValue: validateEnvVar(value, "envValue") })); - handleEnvValue('envValue', value, idx, onChange, additem, itemCount, item.envValue); + handleEnvValue('envValue', value, idx, onChange, additem, itemCount, item.envKey); }} /> diff --git a/test/check-application b/test/check-application index 0c6bd26af..1c4f012b4 100755 --- a/test/check-application +++ b/test/check-application @@ -1928,11 +1928,22 @@ class TestApplication(testlib.MachineCase): b.set_input_text('#run-image-dialog-env-2-value', 'GRAPE') b.click('#run-image-dialog-env-2-btn-close') b.click('.env-form .btn-add') - # Test inputting an key=var entry - b.set_val('#run-image-dialog-env-3-value', - "RHUBARB=STRAWBERRY DURIAN=LEMON TEST_URL=wss://cockpit/?start=1&stop=0") + # Test inputting an key=var entry; that should auto-split on '=' + b.set_input_text('#run-image-dialog-env-3-value', "RHUBARB=STRAWBERRY", value_check=False) + b.wait_val("#run-image-dialog-env-3-key", "RHUBARB") + b.wait_val("#run-image-dialog-env-3-value", "STRAWBERRY") + + # with copy&paste you can also set multiple variables + b.click('.env-form .btn-add') + b.set_val('#run-image-dialog-env-4-value', + "DURIAN=LEMON TEST_URL=wss://cockpit/?start=1&stop=0") # set_val does not trigger onChange so append a space. - b.set_input_text('#run-image-dialog-env-3-value', ' ', append=True, value_check=False) + b.set_input_text('#run-image-dialog-env-4-value', ' ', append=True, value_check=False) + + b.wait_val("#run-image-dialog-env-4-key", "DURIAN") + b.wait_val("#run-image-dialog-env-4-value", "LEMON") + b.wait_val("#run-image-dialog-env-5-key", "TEST_URL") + b.wait_val("#run-image-dialog-env-5-value", "wss://cockpit/?start=1&stop=0") b.click('.env-form .btn-add') b.set_input_text('#run-image-dialog-env-6-key', 'HOSTNAME')