Skip to content

Commit

Permalink
Merge branch 'All-Hands-AI:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
RainRat authored Feb 18, 2025
2 parents afc5f70 + 96d1992 commit f8316e6
Show file tree
Hide file tree
Showing 9 changed files with 195 additions and 148 deletions.
2 changes: 2 additions & 0 deletions docs/modules/usage/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
- Linux
- Windows with [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) and [Docker Desktop support](https://docs.docker.com/desktop/setup/install/windows-install/#system-requirements)

A system with a modern processor and a minimum of **4GB RAM** is recommended to run OpenHands.

## Prerequisites

<details>
Expand Down
37 changes: 34 additions & 3 deletions frontend/__tests__/routes/settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ describe("Settings Screen", () => {
});
});

it("should render an indicator if the GitHub token is not set", async () => {
// TODO: Set a better unset indicator
it.skip("should render an indicator if the GitHub token is not set", async () => {
getSettingsSpy.mockResolvedValue({
...MOCK_DEFAULT_USER_SETTINGS,
github_token_is_set: false,
Expand All @@ -97,6 +98,20 @@ describe("Settings Screen", () => {
});
});

it("should set asterik placeholder if the GitHub token is set", async () => {
getSettingsSpy.mockResolvedValue({
...MOCK_DEFAULT_USER_SETTINGS,
github_token_is_set: true,
});

renderSettingsScreen();

await waitFor(() => {
const input = screen.getByTestId("github-token-input");
expect(input).toHaveProperty("placeholder", "**********");
});
});

it("should render an indicator if the GitHub token is set", async () => {
getSettingsSpy.mockResolvedValue({
...MOCK_DEFAULT_USER_SETTINGS,
Expand Down Expand Up @@ -314,7 +329,8 @@ describe("Settings Screen", () => {
// screen.getByTestId("security-analyzer-input");
});

it("should render an indicator if the LLM API key is not set", async () => {
// TODO: Set a better unset indicator
it.skip("should render an indicator if the LLM API key is not set", async () => {
getSettingsSpy.mockResolvedValueOnce({
...MOCK_DEFAULT_USER_SETTINGS,
llm_api_key: null,
Expand Down Expand Up @@ -443,7 +459,22 @@ describe("Settings Screen", () => {
expect(input).toHaveValue("1x (2 core, 8G)");
});

it("should save the runtime settings when the 'Save Changes' button is clicked", async () => {
it("should always have the runtime input disabled", async () => {
getConfigSpy.mockResolvedValue({
APP_MODE: "saas",
GITHUB_CLIENT_ID: "123",
POSTHOG_CLIENT_KEY: "456",
});

renderSettingsScreen();

await toggleAdvancedSettings(userEvent.setup());

const input = await screen.findByTestId("runtime-settings-input");
expect(input).toBeDisabled();
});

it.skip("should save the runtime settings when the 'Save Changes' button is clicked", async () => {
const user = userEvent.setup();
getConfigSpy.mockResolvedValue({
APP_MODE: "saas",
Expand Down
Loading

0 comments on commit f8316e6

Please sign in to comment.