Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(frontend): Fix auth modal tests by adding required providersConfigured prop (#9823)

sp.wackf6d99234f148
diff --git a/frontend/__tests__/components/features/auth-modal.test.tsx b/frontend/__tests__/components/features/auth-modal.test.tsx
index 875bb1c852..dc7be3b474 100644
--- a/frontend/__tests__/components/features/auth-modal.test.tsx
+++ b/frontend/__tests__/components/features/auth-modal.test.tsx
@@ -19,7 +19,13 @@ describe("AuthModal", () => {
});
it("should render the GitHub and GitLab buttons", () => {
- render(<AuthModal githubAuthUrl="mock-url" appMode="saas" />);
+ render(
+ <AuthModal
+ githubAuthUrl="mock-url"
+ appMode="saas"
+ providersConfigured={["github", "gitlab"]}
+ />,
+ );
const githubButton = screen.getByRole("button", {
name: "GITHUB$CONNECT_TO_GITHUB",
@@ -35,7 +41,13 @@ describe("AuthModal", () => {
it("should redirect to GitHub auth URL when GitHub button is clicked", async () => {
const user = userEvent.setup();
const mockUrl = "https://github.com/login/oauth/authorize";
- render(<AuthModal githubAuthUrl={mockUrl} appMode="saas" />);
+ render(
+ <AuthModal
+ githubAuthUrl={mockUrl}
+ appMode="saas"
+ providersConfigured={["github"]}
+ />,
+ );
const githubButton = screen.getByRole("button", {
name: "GITHUB$CONNECT_TO_GITHUB",
@@ -52,7 +64,6 @@ describe("AuthModal", () => {
const termsSection = screen.getByTestId("auth-modal-terms-of-service");
expect(termsSection).toBeInTheDocument();
-
// Check that all text content is present in the paragraph
expect(termsSection).toHaveTextContent(
"AUTH$BY_SIGNING_UP_YOU_AGREE_TO_OUR",