OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

test(frontend): create new test and update existing ones

Open amanape opened this issue 1 year ago • 1 comments

This is updating the relevant tests for the changes made by #1169.

@rbren If you can confirm that the expected behavior for your getUpdatedSettings function sets undefined values for keys that have not been modified. For example:

    const oldSettings = {
      [ArgConfigType.LLM_MODEL]: "gpt-4-0125-preview",
      [ArgConfigType.AGENT]: "MonologueAgent",
      [ArgConfigType.LANGUAGE]: "en",
    };
    const newSettings = {
      [ArgConfigType.AGENT]: "OtherAgent",
    };

    const result = getUpdatedSettings(newSettings, oldSettings);

result is actually:

  Object {
    "AGENT": "OtherAgent",
    "LANGUAGE": undefined,
    "LLM_MODEL": undefined,
  }

If this is the expected behavior, then the test file is OK. If not, let me know so I can make the appropriate changes to the test file to reflect the proper behavior.

Let me know if I'm missing a specific edge case in the test files.

amanape avatar Apr 17 '24 18:04 amanape

@amanape I think it'd be better if those keys just weren't present. (Honestly I expected || undefined to work that way! 😬)

rbren avatar Apr 18 '24 11:04 rbren