forked from All-Hands-AI/OpenHands
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
587 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,9 @@ jobs: | |
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: "Set up docker layer caching" | ||
uses: satackey/[email protected] | ||
continue-on-error: true | ||
- name: Build and push app image | ||
if: "!github.event.pull_request.head.repo.fork" | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
frontend/__tests__/components/chat/expandable-message.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { describe, expect, it } from "vitest"; | ||
import { screen } from "@testing-library/react"; | ||
import { renderWithProviders } from "test-utils"; | ||
import { ExpandableMessage } from "#/components/features/chat/expandable-message"; | ||
|
||
describe("ExpandableMessage", () => { | ||
it("should render with neutral border for non-action messages", () => { | ||
renderWithProviders(<ExpandableMessage message="Hello" type="thought" />); | ||
const element = screen.getByText("Hello"); | ||
const container = element.closest("div.flex.gap-2.items-center.justify-between"); | ||
expect(container).toHaveClass("border-neutral-300"); | ||
expect(screen.queryByTestId("status-icon")).not.toBeInTheDocument(); | ||
}); | ||
|
||
it("should render with neutral border for error messages", () => { | ||
renderWithProviders(<ExpandableMessage message="Error occurred" type="error" />); | ||
const element = screen.getByText("Error occurred"); | ||
const container = element.closest("div.flex.gap-2.items-center.justify-between"); | ||
expect(container).toHaveClass("border-neutral-300"); | ||
expect(screen.queryByTestId("status-icon")).not.toBeInTheDocument(); | ||
}); | ||
|
||
it("should render with success icon for successful action messages", () => { | ||
renderWithProviders( | ||
<ExpandableMessage | ||
message="Command executed successfully" | ||
type="action" | ||
success={true} | ||
/> | ||
); | ||
const element = screen.getByText("Command executed successfully"); | ||
const container = element.closest("div.flex.gap-2.items-center.justify-between"); | ||
expect(container).toHaveClass("border-neutral-300"); | ||
const icon = screen.getByTestId("status-icon"); | ||
expect(icon).toHaveClass("fill-success"); | ||
}); | ||
|
||
it("should render with error icon for failed action messages", () => { | ||
renderWithProviders( | ||
<ExpandableMessage | ||
message="Command failed" | ||
type="action" | ||
success={false} | ||
/> | ||
); | ||
const element = screen.getByText("Command failed"); | ||
const container = element.closest("div.flex.gap-2.items-center.justify-between"); | ||
expect(container).toHaveClass("border-neutral-300"); | ||
const icon = screen.getByTestId("status-icon"); | ||
expect(icon).toHaveClass("fill-danger"); | ||
}); | ||
|
||
it("should render with neutral border and no icon for action messages without success prop", () => { | ||
renderWithProviders(<ExpandableMessage message="Running command" type="action" />); | ||
const element = screen.getByText("Running command"); | ||
const container = element.closest("div.flex.gap-2.items-center.justify-between"); | ||
expect(container).toHaveClass("border-neutral-300"); | ||
expect(screen.queryByTestId("status-icon")).not.toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.