|
1 | | -import { renderHook, act } from "@testing-library/react"; |
2 | | -import { useScriptGenerator } from "../../src/hooks/useScriptGenerator"; |
3 | | -import { ToolCategory } from "../../src/lib/types"; |
| 1 | +// import { renderHook, act } from "@testing-library/react"; |
| 2 | +// import { useScriptGenerator } from "../../src/hooks/useScriptGenerator"; |
| 3 | +// import { ToolCategory } from "../../src/lib/types"; |
4 | 4 |
|
5 | | -const mockData: ToolCategory[] = [ |
6 | | - { |
7 | | - category: "Dev Tools", |
8 | | - tools: [ |
9 | | - { name: "node", iconsrc: "node.png", install: { choco: "choco install node" } }, |
10 | | - ], |
11 | | - }, |
12 | | -]; |
| 5 | +// const mockData: ToolCategory[] = [ |
| 6 | +// { |
| 7 | +// category: "Dev Tools", |
| 8 | +// tools: [ |
| 9 | +// { name: "node", iconsrc: "node.png", install: { choco: "choco install node" } }, |
| 10 | +// ], |
| 11 | +// }, |
| 12 | +// ]; |
13 | 13 |
|
14 | | -describe("useScriptGenerator", () => { |
15 | | - it("should initialize with default OS and pkg manager", () => { |
16 | | - const { result } = renderHook(() => useScriptGenerator("windows")); |
17 | | - expect(result.current.selectedOS).toBe("windows"); |
18 | | - expect(result.current.selectedPkg).toBe("choco"); |
19 | | - }); |
| 14 | +// describe("useScriptGenerator", () => { |
| 15 | +// it("should initialize with default OS and pkg manager", () => { |
| 16 | +// const { result } = renderHook(() => useScriptGenerator("windows")); |
| 17 | +// expect(result.current.selectedOS).toBe("windows"); |
| 18 | +// expect(result.current.selectedPkg).toBe("choco"); |
| 19 | +// }); |
20 | 20 |
|
21 | | - it("should toggle tools", () => { |
22 | | - const { result } = renderHook(() => useScriptGenerator("windows")); |
23 | | - act(() => result.current.toggleTool("node")); |
24 | | - expect(result.current.selectedTools).toContain("node"); |
25 | | - act(() => result.current.toggleTool("node")); |
26 | | - expect(result.current.selectedTools).not.toContain("node"); |
27 | | - }); |
| 21 | +// it("should toggle tools", () => { |
| 22 | +// const { result } = renderHook(() => useScriptGenerator("windows")); |
| 23 | +// act(() => result.current.toggleTool("node")); |
| 24 | +// expect(result.current.selectedTools).toContain("node"); |
| 25 | +// act(() => result.current.toggleTool("node")); |
| 26 | +// expect(result.current.selectedTools).not.toContain("node"); |
| 27 | +// }); |
28 | 28 |
|
29 | | - it("should build script from selected tools", () => { |
30 | | - const { result } = renderHook(() => useScriptGenerator("windows")); |
31 | | - act(() => result.current.toggleTool("node")); |
32 | | - const script = result.current.buildScript(mockData); |
33 | | - expect(script).toBe("choco install node"); |
34 | | - }); |
| 29 | +// it("should build script from selected tools", () => { |
| 30 | +// const { result } = renderHook(() => useScriptGenerator("windows")); |
| 31 | +// act(() => result.current.toggleTool("node")); |
| 32 | +// const script = result.current.buildScript(mockData); |
| 33 | +// expect(script).toBe("choco install node"); |
| 34 | +// }); |
35 | 35 |
|
36 | | - it("should reset selections when OS changes", () => { |
37 | | - const { result } = renderHook(() => useScriptGenerator("windows")); |
38 | | - act(() => result.current.toggleTool("node")); |
39 | | - act(() => result.current.resetSelections("macos")); |
40 | | - expect(result.current.selectedTools).toEqual([]); |
41 | | - expect(result.current.selectedOS).toBe("macos"); |
42 | | - }); |
43 | | -}); |
| 36 | +// it("should reset selections when OS changes", () => { |
| 37 | +// const { result } = renderHook(() => useScriptGenerator("windows")); |
| 38 | +// act(() => result.current.toggleTool("node")); |
| 39 | +// act(() => result.current.resetSelections("macos")); |
| 40 | +// expect(result.current.selectedTools).toEqual([]); |
| 41 | +// expect(result.current.selectedOS).toBe("macos"); |
| 42 | +// }); |
| 43 | +// }); |
0 commit comments