mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-07 02:58:15 +00:00
fix: updating the Gemini.spec.tsx unit test
- testing when it is hidden - testing when users click on the collapsible trigger and model configuration appears
This commit is contained in:
parent
4200cff28a
commit
0d72f08946
1 changed files with 11 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { render, screen } from "@testing-library/react"
|
||||
import userEvent from "@testing-library/user-event"
|
||||
import { Gemini } from "../Gemini"
|
||||
import type { ProviderSettings } from "@roo-code/types"
|
||||
|
||||
|
|
@ -43,10 +44,19 @@ vi.mock("@src/components/common/VSCodeButtonLink", () => ({
|
|||
}))
|
||||
|
||||
describe("Gemini provider settings", () => {
|
||||
it("renders sliders for topP, topK and maxOutputTokens", () => {
|
||||
it("renders sliders for topP, topK and maxOutputTokens after expanding", async () => {
|
||||
const user = userEvent.setup()
|
||||
const setApiField = vi.fn()
|
||||
const config: ProviderSettings = {}
|
||||
render(<Gemini apiConfiguration={config} setApiConfigurationField={setApiField} />)
|
||||
|
||||
expect(screen.queryByTestId("slider-top-p")).not.toBeInTheDocument()
|
||||
expect(screen.queryByTestId("slider-top-k")).not.toBeInTheDocument()
|
||||
expect(screen.queryByTestId("slider-max-output-tokens")).not.toBeInTheDocument()
|
||||
|
||||
const trigger = screen.getByText("settings:providers.geminiSections.modelParameters.title")
|
||||
await user.click(trigger)
|
||||
|
||||
expect(screen.getByTestId("slider-top-p")).toBeInTheDocument()
|
||||
expect(screen.getByTestId("slider-top-k")).toBeInTheDocument()
|
||||
expect(screen.getByTestId("slider-max-output-tokens")).toBeInTheDocument()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue