mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-24 01:54:25 +00:00
Refactor ConfigContext hooks
This commit is contained in:
@@ -14,7 +14,7 @@ import ParseCommandDialog from "@/components/ParseCommandDialog";
|
||||
import InstanceSettingsCard from "@/components/instance/InstanceSettingsCard";
|
||||
import BackendConfigurationCard from "@/components/instance/BackendConfigurationCard";
|
||||
import { Upload } from "lucide-react";
|
||||
import { useInstanceDefaults, useBackendSettings } from "@/contexts/ConfigContext";
|
||||
import { useInstanceDefaults, useBackendSettings } from "@/hooks/useConfig";
|
||||
|
||||
interface InstanceDialogProps {
|
||||
open: boolean;
|
||||
|
||||
@@ -2,11 +2,10 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
||||
import { render, screen, waitFor } from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import InstanceDialog from '@/components/InstanceDialog'
|
||||
import type { Instance } from '@/types/instance'
|
||||
import { BackendType } from '@/types/instance'
|
||||
import { BackendType, type Instance } from '@/types/instance'
|
||||
|
||||
// Mock the ConfigContext hooks
|
||||
vi.mock('@/contexts/ConfigContext', () => ({
|
||||
// Mock the ConfigContext helper hooks
|
||||
vi.mock('@/hooks/useConfig', () => ({
|
||||
useInstanceDefaults: () => ({
|
||||
autoRestart: true,
|
||||
maxRestarts: 3,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { BackendType, type CreateInstanceOptions } from '@/types/instance'
|
||||
import CheckboxInput from '@/components/form/CheckboxInput'
|
||||
import TextInput from '@/components/form/TextInput'
|
||||
import EnvVarsInput from '@/components/form/EnvVarsInput'
|
||||
import { useBackendSettings } from '@/contexts/ConfigContext'
|
||||
import { useBackendSettings } from '@/hooks/useConfig'
|
||||
|
||||
interface ExecutionContextSectionProps {
|
||||
formData: CreateInstanceOptions
|
||||
|
||||
Reference in New Issue
Block a user