mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
test(webview): mock ExtensionStateContext in AutoApproveToggle tests to satisfy provider dependency
This commit is contained in:
parent
24a39fd6a6
commit
d04ec522c9
1 changed files with 8 additions and 0 deletions
|
|
@ -14,6 +14,14 @@ vi.mock("@/i18n/TranslationContext", () => {
|
|||
}
|
||||
})
|
||||
|
||||
// Ensure components relying on ExtensionStateContext don't crash in tests
|
||||
vi.mock("@/context/ExtensionStateContext", () => {
|
||||
return {
|
||||
useExtensionState: () => ({ browserToolEnabled: true }),
|
||||
ExtensionStateContextProvider: ({ children }: any) => children,
|
||||
}
|
||||
})
|
||||
|
||||
describe("AutoApproveToggle", () => {
|
||||
const mockOnToggle = vi.fn()
|
||||
const initialProps = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue