|
|
@@ -21,6 +21,7 @@ vi.mock("@src/i18n/TranslationContext", () => ({
|
|
|
"cloud:remoteControlDescription":
|
|
|
"Enable following and interacting with tasks in this workspace with Roo Code Cloud",
|
|
|
"cloud:profilePicture": "Profile picture",
|
|
|
+ "cloud:cloudUrlPillLabel": "Roo Code Cloud URL: ",
|
|
|
}
|
|
|
return translations[key] || key
|
|
|
},
|
|
|
@@ -148,4 +149,70 @@ describe("CloudView", () => {
|
|
|
expect(screen.queryByTestId("remote-control-toggle")).not.toBeInTheDocument()
|
|
|
expect(screen.queryByText("Roomote Control")).not.toBeInTheDocument()
|
|
|
})
|
|
|
+
|
|
|
+ it("should not display cloud URL pill when pointing to production", () => {
|
|
|
+ const mockUserInfo = {
|
|
|
+ name: "Test User",
|
|
|
+ email: "[email protected]",
|
|
|
+ }
|
|
|
+
|
|
|
+ render(
|
|
|
+ <CloudView
|
|
|
+ userInfo={mockUserInfo}
|
|
|
+ isAuthenticated={true}
|
|
|
+ cloudApiUrl="https://app.roocode.com"
|
|
|
+ onDone={() => {}}
|
|
|
+ />,
|
|
|
+ )
|
|
|
+
|
|
|
+ // Check that the cloud URL pill is NOT displayed for production URL
|
|
|
+ expect(screen.queryByText(/Roo Code Cloud URL:/)).not.toBeInTheDocument()
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should display cloud URL pill when pointing to non-production environment", () => {
|
|
|
+ const mockUserInfo = {
|
|
|
+ name: "Test User",
|
|
|
+ email: "[email protected]",
|
|
|
+ }
|
|
|
+
|
|
|
+ render(
|
|
|
+ <CloudView
|
|
|
+ userInfo={mockUserInfo}
|
|
|
+ isAuthenticated={true}
|
|
|
+ cloudApiUrl="https://staging.roocode.com"
|
|
|
+ onDone={() => {}}
|
|
|
+ />,
|
|
|
+ )
|
|
|
+
|
|
|
+ // Check that the cloud URL pill is displayed with the staging URL
|
|
|
+ expect(screen.getByText(/Roo Code Cloud URL:/)).toBeInTheDocument()
|
|
|
+ expect(screen.getByText("https://staging.roocode.com")).toBeInTheDocument()
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should display cloud URL pill for non-authenticated users when not pointing to production", () => {
|
|
|
+ render(
|
|
|
+ <CloudView
|
|
|
+ userInfo={null}
|
|
|
+ isAuthenticated={false}
|
|
|
+ cloudApiUrl="https://dev.roocode.com"
|
|
|
+ onDone={() => {}}
|
|
|
+ />,
|
|
|
+ )
|
|
|
+
|
|
|
+ // Check that the cloud URL pill is displayed even when not authenticated
|
|
|
+ expect(screen.getByText(/Roo Code Cloud URL:/)).toBeInTheDocument()
|
|
|
+ expect(screen.getByText("https://dev.roocode.com")).toBeInTheDocument()
|
|
|
+ })
|
|
|
+
|
|
|
+ it("should not display cloud URL pill when cloudApiUrl is undefined", () => {
|
|
|
+ const mockUserInfo = {
|
|
|
+ name: "Test User",
|
|
|
+ email: "[email protected]",
|
|
|
+ }
|
|
|
+
|
|
|
+ render(<CloudView userInfo={mockUserInfo} isAuthenticated={true} onDone={() => {}} />)
|
|
|
+
|
|
|
+ // Check that the cloud URL pill is NOT displayed when cloudApiUrl is undefined
|
|
|
+ expect(screen.queryByText(/Roo Code Cloud URL:/)).not.toBeInTheDocument()
|
|
|
+ })
|
|
|
})
|