@agents-inc/cli 0.77.0 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/{chunk-ZIZFTSQY.js → chunk-7HGMFJ4Y.js} +2 -2
- package/dist/{chunk-R6QNVMN5.js → chunk-B4C2S5LP.js} +11 -11
- package/dist/{chunk-R6QNVMN5.js.map → chunk-B4C2S5LP.js.map} +1 -1
- package/dist/{chunk-B66E255O.js → chunk-D4T3HHE7.js} +3 -3
- package/dist/chunk-D4T3HHE7.js.map +1 -0
- package/dist/{chunk-KMLJCO5H.js → chunk-F4IZ3UAS.js} +15 -21
- package/dist/chunk-F4IZ3UAS.js.map +1 -0
- package/dist/{chunk-XU6N3OIS.js → chunk-HANGA633.js} +2 -6
- package/dist/{chunk-XU6N3OIS.js.map → chunk-HANGA633.js.map} +1 -1
- package/dist/{chunk-2I5SXGXR.js → chunk-KQDGLEBF.js} +80 -5
- package/dist/chunk-KQDGLEBF.js.map +1 -0
- package/dist/{chunk-G3YSDQJ2.js → chunk-KVRR4PEJ.js} +46 -37
- package/dist/chunk-KVRR4PEJ.js.map +1 -0
- package/dist/{chunk-J5OOAKB5.js → chunk-LVBRC2CP.js} +1 -5
- package/dist/chunk-LVBRC2CP.js.map +1 -0
- package/dist/chunk-N2XGUAJU.js +34 -0
- package/dist/{chunk-KB57OPUL.js.map → chunk-N2XGUAJU.js.map} +1 -1
- package/dist/{chunk-CY23HPDE.js → chunk-N34D3ROY.js} +10 -11
- package/dist/chunk-N34D3ROY.js.map +1 -0
- package/dist/{chunk-PDYKGJGR.js → chunk-NKLNT7N7.js} +3 -20
- package/dist/chunk-NKLNT7N7.js.map +1 -0
- package/dist/{chunk-CZLXZ75E.js → chunk-OIHZ2YH3.js} +107 -69
- package/dist/chunk-OIHZ2YH3.js.map +1 -0
- package/dist/{chunk-SGKNE6EJ.js → chunk-OOWNDQCG.js} +2 -2
- package/dist/{chunk-WMTYOK4E.js → chunk-OTMIGYBB.js} +48 -6
- package/dist/chunk-OTMIGYBB.js.map +1 -0
- package/dist/chunk-PZERKWE2.js +114 -0
- package/dist/chunk-PZERKWE2.js.map +1 -0
- package/dist/{chunk-N4KD5PBX.js → chunk-Q755X6QF.js} +2 -2
- package/dist/{chunk-AQ5KP4YW.js → chunk-QD3GQ2CH.js} +3 -3
- package/dist/{chunk-ERHTXNIF.js → chunk-RU5XLS5Q.js} +1 -5
- package/dist/{chunk-ERHTXNIF.js.map → chunk-RU5XLS5Q.js.map} +1 -1
- package/dist/{chunk-UZHD4DBD.js → chunk-SJNUTUSJ.js} +2 -2
- package/dist/{chunk-5DDHCCEB.js → chunk-VDVLM3KB.js} +42 -4
- package/dist/chunk-VDVLM3KB.js.map +1 -0
- package/dist/{chunk-CTZ4GEAD.js → chunk-W46L2PXK.js} +17 -8
- package/dist/chunk-W46L2PXK.js.map +1 -0
- package/dist/{chunk-A6XMJT2Q.js → chunk-YFHVP3VA.js} +3 -10
- package/dist/chunk-YFHVP3VA.js.map +1 -0
- package/dist/commands/build/plugins.js +2 -2
- package/dist/commands/build/stack.js +2 -2
- package/dist/commands/compile.js +32 -16
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/config/index.js +2 -2
- package/dist/commands/config/path.js +1 -1
- package/dist/commands/config/show.js +2 -2
- package/dist/commands/diff.js +29 -9
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +18 -6
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +37 -27
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +1 -1
- package/dist/commands/import/skill.js +1 -1
- package/dist/commands/info.js +1 -1
- package/dist/commands/init.js +18 -18
- package/dist/commands/list.js +1 -1
- package/dist/commands/new/agent.js +2 -2
- package/dist/commands/new/marketplace.js +2 -2
- package/dist/commands/new/skill.js +2 -2
- package/dist/commands/outdated.js +12 -4
- package/dist/commands/outdated.js.map +1 -1
- package/dist/commands/search.js +1 -1
- package/dist/commands/uninstall.js +9 -21
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +20 -10
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.js +1 -1
- package/dist/components/wizard/category-grid.js +1 -1
- package/dist/components/wizard/category-grid.test.js +3 -3
- package/dist/components/wizard/checkbox-grid.js +1 -2
- package/dist/components/wizard/checkbox-grid.test.js +2 -4
- package/dist/components/wizard/checkbox-grid.test.js.map +1 -1
- package/dist/components/wizard/domain-selection.js +4 -5
- package/dist/components/wizard/source-grid.js +1 -1
- package/dist/components/wizard/source-grid.test.js +3 -3
- package/dist/components/wizard/stack-selection.js +3 -3
- package/dist/components/wizard/stats-panel.js +12 -0
- package/dist/components/wizard/step-agents.js +3 -4
- package/dist/components/wizard/step-agents.test.js +7 -6
- package/dist/components/wizard/step-agents.test.js.map +1 -1
- package/dist/components/wizard/step-build.js +5 -6
- package/dist/components/wizard/step-build.test.js +23 -23
- package/dist/components/wizard/step-build.test.js.map +1 -1
- package/dist/components/wizard/step-confirm.js +1 -3
- package/dist/components/wizard/step-confirm.test.js +17 -16
- package/dist/components/wizard/step-confirm.test.js.map +1 -1
- package/dist/components/wizard/step-refine.js +1 -2
- package/dist/components/wizard/step-refine.test.js +1 -2
- package/dist/components/wizard/step-refine.test.js.map +1 -1
- package/dist/components/wizard/step-settings.js +2 -3
- package/dist/components/wizard/step-settings.test.js +8 -9
- package/dist/components/wizard/step-settings.test.js.map +1 -1
- package/dist/components/wizard/step-sources.js +4 -5
- package/dist/components/wizard/step-sources.test.js +7 -9
- package/dist/components/wizard/step-sources.test.js.map +1 -1
- package/dist/components/wizard/step-stack.js +6 -7
- package/dist/components/wizard/step-stack.test.js +16 -15
- package/dist/components/wizard/step-stack.test.js.map +1 -1
- package/dist/components/wizard/view-title.js +21 -3
- package/dist/components/wizard/view-title.js.map +1 -1
- package/dist/components/wizard/wizard-layout.js +5 -4
- package/dist/components/wizard/wizard-tabs.js +1 -1
- package/dist/components/wizard/wizard-tabs.test.js +1 -1
- package/dist/components/wizard/wizard.js +17 -17
- package/dist/hooks/init.js +18 -18
- package/dist/{source-loader-H3QLG5AE.js → source-loader-D3VIG3GM.js} +2 -2
- package/dist/{source-manager-ZDBUHGIR.js → source-manager-FPYFJRR7.js} +2 -2
- package/dist/source-manager-FPYFJRR7.js.map +1 -0
- package/dist/stores/wizard-store.js +2 -2
- package/dist/stores/wizard-store.test.js +4 -4
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2I5SXGXR.js.map +0 -1
- package/dist/chunk-5DDHCCEB.js.map +0 -1
- package/dist/chunk-A6XMJT2Q.js.map +0 -1
- package/dist/chunk-B66E255O.js.map +0 -1
- package/dist/chunk-CTZ4GEAD.js.map +0 -1
- package/dist/chunk-CY23HPDE.js.map +0 -1
- package/dist/chunk-CZLXZ75E.js.map +0 -1
- package/dist/chunk-G3YSDQJ2.js.map +0 -1
- package/dist/chunk-J5OOAKB5.js.map +0 -1
- package/dist/chunk-JNQKCZA3.js +0 -28
- package/dist/chunk-JNQKCZA3.js.map +0 -1
- package/dist/chunk-KB57OPUL.js +0 -40
- package/dist/chunk-KMLJCO5H.js.map +0 -1
- package/dist/chunk-PDYKGJGR.js.map +0 -1
- package/dist/chunk-WMTYOK4E.js.map +0 -1
- /package/dist/{chunk-ZIZFTSQY.js.map → chunk-7HGMFJ4Y.js.map} +0 -0
- /package/dist/{chunk-SGKNE6EJ.js.map → chunk-OOWNDQCG.js.map} +0 -0
- /package/dist/{chunk-N4KD5PBX.js.map → chunk-Q755X6QF.js.map} +0 -0
- /package/dist/{chunk-AQ5KP4YW.js.map → chunk-QD3GQ2CH.js.map} +0 -0
- /package/dist/{chunk-UZHD4DBD.js.map → chunk-SJNUTUSJ.js.map} +0 -0
- /package/dist/{source-loader-H3QLG5AE.js.map → components/wizard/stats-panel.js.map} +0 -0
- /package/dist/{source-manager-ZDBUHGIR.js.map → source-loader-D3VIG3GM.js.map} +0 -0
|
@@ -33,18 +33,18 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
StepBuild,
|
|
35
35
|
validateBuildStep
|
|
36
|
-
} from "../../chunk-
|
|
36
|
+
} from "../../chunk-KVRR4PEJ.js";
|
|
37
|
+
import "../../chunk-PZERKWE2.js";
|
|
37
38
|
import "../../chunk-K77I4XGL.js";
|
|
38
|
-
import "../../chunk-
|
|
39
|
+
import "../../chunk-W46L2PXK.js";
|
|
39
40
|
import "../../chunk-P2FHS5IS.js";
|
|
40
41
|
import {
|
|
41
42
|
orderDomains
|
|
42
43
|
} from "../../chunk-7JQIMEUX.js";
|
|
43
|
-
import "../../chunk-JNQKCZA3.js";
|
|
44
44
|
import "../../chunk-FFMWFEUH.js";
|
|
45
|
-
import "../../chunk-
|
|
45
|
+
import "../../chunk-N34D3ROY.js";
|
|
46
46
|
import "../../chunk-HK53FRMU.js";
|
|
47
|
-
import "../../chunk-
|
|
47
|
+
import "../../chunk-OIHZ2YH3.js";
|
|
48
48
|
import "../../chunk-IFCASC6R.js";
|
|
49
49
|
import {
|
|
50
50
|
initializeMatrix
|
|
@@ -161,39 +161,39 @@ describe("StepBuild component", () => {
|
|
|
161
161
|
});
|
|
162
162
|
});
|
|
163
163
|
describe("domain header", () => {
|
|
164
|
-
it("should
|
|
164
|
+
it("should render domain categories when multiple domains selected", () => {
|
|
165
165
|
const { lastFrame, unmount } = renderStepBuild({
|
|
166
166
|
selectedDomains: ["web", "api"]
|
|
167
167
|
});
|
|
168
168
|
cleanup = unmount;
|
|
169
169
|
const output = lastFrame();
|
|
170
|
-
globalExpect(output).toContain("
|
|
170
|
+
globalExpect(output).toContain("Framework");
|
|
171
171
|
});
|
|
172
|
-
it("should
|
|
172
|
+
it("should render domain categories when only one selected", () => {
|
|
173
173
|
const { lastFrame, unmount } = renderStepBuild({
|
|
174
174
|
selectedDomains: ["web"]
|
|
175
175
|
});
|
|
176
176
|
cleanup = unmount;
|
|
177
177
|
const output = lastFrame();
|
|
178
|
-
globalExpect(output).toContain("
|
|
178
|
+
globalExpect(output).toContain("Framework");
|
|
179
179
|
});
|
|
180
|
-
it("should
|
|
180
|
+
it("should render correct categories for final domain", () => {
|
|
181
181
|
const { lastFrame, unmount } = renderStepBuild({
|
|
182
182
|
selectedDomains: ["web", "api"],
|
|
183
183
|
domain: "api"
|
|
184
184
|
});
|
|
185
185
|
cleanup = unmount;
|
|
186
186
|
const output = lastFrame();
|
|
187
|
-
globalExpect(output).toContain("
|
|
187
|
+
globalExpect(output).toContain("API Framework");
|
|
188
188
|
});
|
|
189
|
-
it("should
|
|
189
|
+
it("should render correct categories for domain", () => {
|
|
190
190
|
const { lastFrame, unmount } = renderStepBuild({
|
|
191
191
|
selectedDomains: ["web", "api", "cli"],
|
|
192
192
|
domain: "api"
|
|
193
193
|
});
|
|
194
194
|
cleanup = unmount;
|
|
195
195
|
const output = lastFrame();
|
|
196
|
-
globalExpect(output).toContain("
|
|
196
|
+
globalExpect(output).toContain("API Framework");
|
|
197
197
|
});
|
|
198
198
|
it("should display domains in canonical order regardless of selection order", () => {
|
|
199
199
|
globalExpect(orderDomains(["cli", "mobile", "api", "web"])).toEqual([
|
|
@@ -357,25 +357,25 @@ describe("StepBuild component", () => {
|
|
|
357
357
|
});
|
|
358
358
|
});
|
|
359
359
|
describe("multi-domain scenarios", () => {
|
|
360
|
-
it("should
|
|
360
|
+
it("should render web categories in multi-domain flow", () => {
|
|
361
361
|
const { lastFrame, unmount } = renderStepBuild({
|
|
362
362
|
domain: "web",
|
|
363
363
|
selectedDomains: ["web", "api"]
|
|
364
364
|
});
|
|
365
365
|
cleanup = unmount;
|
|
366
366
|
const output = lastFrame();
|
|
367
|
-
globalExpect(output).toContain("
|
|
367
|
+
globalExpect(output).toContain("Framework");
|
|
368
368
|
});
|
|
369
|
-
it("should
|
|
369
|
+
it("should render API categories for last domain in multi-domain flow", () => {
|
|
370
370
|
const { lastFrame, unmount } = renderStepBuild({
|
|
371
371
|
domain: "api",
|
|
372
372
|
selectedDomains: ["web", "api"]
|
|
373
373
|
});
|
|
374
374
|
cleanup = unmount;
|
|
375
375
|
const output = lastFrame();
|
|
376
|
-
globalExpect(output).toContain("
|
|
376
|
+
globalExpect(output).toContain("API Framework");
|
|
377
377
|
});
|
|
378
|
-
it("should
|
|
378
|
+
it("should render correct domain categories in three-domain flow", () => {
|
|
379
379
|
const cliFrameworkCategory = { ...CLI_FRAMEWORK_CATEGORY, required: true, order: 0 };
|
|
380
380
|
const commanderSkill = createMockSkill("cli-framework-commander", {
|
|
381
381
|
displayName: "commander"
|
|
@@ -407,23 +407,23 @@ describe("StepBuild component", () => {
|
|
|
407
407
|
});
|
|
408
408
|
cleanup = unmount;
|
|
409
409
|
const output = lastFrame();
|
|
410
|
-
globalExpect(output).toContain("
|
|
410
|
+
globalExpect(output).toContain("API Framework");
|
|
411
411
|
});
|
|
412
412
|
});
|
|
413
413
|
describe("header and selection count", () => {
|
|
414
|
-
it("should
|
|
414
|
+
it("should render categories for the current domain", () => {
|
|
415
415
|
const { lastFrame, unmount } = renderStepBuild();
|
|
416
416
|
cleanup = unmount;
|
|
417
417
|
const output = lastFrame();
|
|
418
|
-
globalExpect(output).toContain("
|
|
418
|
+
globalExpect(output).toContain("Framework");
|
|
419
419
|
});
|
|
420
|
-
it("should render
|
|
420
|
+
it("should render categories for API domain", () => {
|
|
421
421
|
const { lastFrame, unmount } = renderStepBuild({
|
|
422
422
|
domain: "api"
|
|
423
423
|
});
|
|
424
424
|
cleanup = unmount;
|
|
425
425
|
const output = lastFrame();
|
|
426
|
-
globalExpect(output).toContain("
|
|
426
|
+
globalExpect(output).toContain("API Framework");
|
|
427
427
|
});
|
|
428
428
|
});
|
|
429
429
|
describe("keyboard help text", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/components/wizard/step-build.test.tsx"],"sourcesContent":["import { render } from \"ink-testing-library\";\nimport { indexBy } from \"remeda\";\nimport { describe, expect, it, beforeEach, afterEach, vi } from \"vitest\";\nimport { StepBuild, type StepBuildProps } from \"./step-build\";\nimport { validateBuildStep } from \"../../lib/wizard/index\";\nimport { orderDomains } from \"./utils\";\nimport type { CategoryRow as GridCategoryRow } from \"./category-grid\";\nimport type {\n CategoryDefinition,\n Domain,\n ResolvedSkill,\n Category,\n CategorySelections,\n SkillId,\n} from \"../../types\";\nimport {\n ENTER,\n ESCAPE,\n RENDER_DELAY_MS,\n INPUT_DELAY_MS,\n delay,\n} from \"../../lib/__tests__/test-constants\";\nimport { createMockSkill, createMockMatrix, SKILLS } from \"../../lib/__tests__/helpers\";\nimport { initializeMatrix } from \"../../lib/matrix/matrix-provider\";\nimport {\n WEB_FRAMEWORK_CATEGORY,\n WEB_STYLING_CATEGORY,\n WEB_STATE_CATEGORY,\n API_FRAMEWORK_CATEGORY,\n API_DATABASE_CATEGORY,\n CLI_FRAMEWORK_CATEGORY,\n} from \"../../lib/__tests__/mock-data/mock-categories.js\";\n\nconst buildTestMatrix = (categories: CategoryDefinition[], skills: ResolvedSkill[]) =>\n createMockMatrix(...skills, {\n // Test data construction cast: indexBy returns generic Record\n categories: indexBy(categories, (c) => c.id) as Record<Category, CategoryDefinition>,\n });\n\nconst defaultMatrix = buildTestMatrix(\n [\n WEB_FRAMEWORK_CATEGORY,\n WEB_STYLING_CATEGORY,\n WEB_STATE_CATEGORY,\n API_FRAMEWORK_CATEGORY,\n API_DATABASE_CATEGORY,\n ],\n [\n SKILLS.react,\n SKILLS.vue,\n SKILLS.tailwind,\n SKILLS.scss,\n SKILLS.zustand,\n SKILLS.hono,\n SKILLS.drizzle,\n ],\n);\n\nconst defaultProps: StepBuildProps = {\n domain: \"web\",\n selectedDomains: [\"web\"],\n selections: {},\n allSelections: [],\n showLabels: false,\n filterIncompatible: false,\n onToggle: vi.fn(),\n onToggleLabels: vi.fn(),\n onToggleFilterIncompatible: vi.fn(),\n onContinue: vi.fn(),\n onBack: vi.fn(),\n};\n\nconst renderStepBuild = (props: Partial<StepBuildProps> = {}) => {\n return render(<StepBuild {...defaultProps} {...props} />);\n};\n\ndescribe(\"StepBuild component\", () => {\n let cleanup: (() => void) | undefined;\n\n beforeEach(() => {\n initializeMatrix(defaultMatrix);\n });\n\n afterEach(() => {\n cleanup?.();\n cleanup = undefined;\n });\n\n describe(\"rendering\", () => {\n it(\"should render CategoryGrid with correct categories for domain\", () => {\n // For web domain with framework-first flow, initially only shows Framework\n // To see other categories, need a framework selection\n const { lastFrame, unmount } = renderStepBuild({\n selections: { \"web-framework\": [\"web-framework-react\"] }, // Framework selected to show other categories\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Web domain should show Framework, Styling, Client State (when framework selected)\n expect(output).toContain(\"Framework\");\n expect(output).toContain(\"Styling\");\n expect(output).toContain(\"Client State\");\n // Should NOT show API categories\n expect(output).not.toContain(\"API Framework\");\n expect(output).not.toContain(\"Database\");\n });\n\n it(\"should render API categories when domain is api\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"api\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // API domain should show API Framework, Database\n expect(output).toContain(\"API Framework\");\n expect(output).toContain(\"Database\");\n // Should NOT show Web categories\n expect(output).not.toContain(\"Styling\");\n expect(output).not.toContain(\"Client State\");\n });\n\n it(\"should render skills as options\", () => {\n // Need framework selected to see other categories in web domain\n const { lastFrame, unmount } = renderStepBuild({\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Framework skills\n expect(output).toContain(\"React\");\n expect(output).toContain(\"Vue\");\n // Styling skills (visible after framework selected)\n expect(output).toContain(\"Tailwind\");\n expect(output).toContain(\"Scss Modules\");\n });\n\n it(\"should show required indicator (*) for required categories\", () => {\n const { lastFrame, unmount } = renderStepBuild();\n cleanup = unmount;\n\n const output = lastFrame();\n // Framework and Styling are required\n expect(output).toContain(\"*\");\n });\n\n it(\"should render categories for the domain\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should render the domain categories\n expect(output).toContain(\"Framework\");\n expect(output).toContain(\"Styling\");\n });\n });\n\n describe(\"domain header\", () => {\n it(\"should show ViewTitle with current domain when multiple domains selected\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selectedDomains: [\"web\", \"api\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize your Web stack\");\n });\n\n it(\"should show ViewTitle with domain when only one selected\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selectedDomains: [\"web\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize your Web stack\");\n });\n\n it(\"should show ViewTitle for current domain on final domain\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selectedDomains: [\"web\", \"api\"],\n domain: \"api\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize your API stack\");\n });\n\n it(\"should show correct domain display names\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selectedDomains: [\"web\", \"api\", \"cli\"],\n domain: \"api\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize your API stack\");\n });\n\n it(\"should display domains in canonical order regardless of selection order\", () => {\n // Domains selected in reverse order: CLI, Mobile, API, Web\n expect(orderDomains([\"cli\", \"mobile\", \"api\", \"web\"])).toEqual([\n \"web\",\n \"api\",\n \"mobile\",\n \"cli\",\n ]);\n });\n\n it(\"should preserve canonical order with partial domain selection\", () => {\n // Only CLI and Web selected, in reverse order\n expect(orderDomains([\"cli\", \"web\"])).toEqual([\"web\", \"cli\"]);\n });\n\n it(\"should place custom domains before built-in domains\", () => {\n expect(orderDomains([\"web\", \"gaming\" as Domain, \"api\", \"devops\" as Domain])).toEqual([\n \"devops\",\n \"gaming\",\n \"web\",\n \"api\",\n ]);\n });\n });\n\n describe(\"category filtering\", () => {\n it(\"should filter categories correctly by domain\", () => {\n // Web domain with framework selected (to bypass framework-first filter)\n const { lastFrame: webFrame, unmount: webUnmount } = renderStepBuild({\n domain: \"web\",\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n const webOutput = webFrame();\n webUnmount();\n\n // API domain (no framework-first filter for API)\n const { lastFrame: apiFrame, unmount: apiUnmount } = renderStepBuild({\n domain: \"api\",\n });\n cleanup = apiUnmount;\n const apiOutput = apiFrame();\n\n // Web should have Framework, Styling, Client State (with framework selected)\n expect(webOutput).toContain(\"Framework\");\n expect(webOutput).toContain(\"Styling\");\n expect(webOutput).toContain(\"Client State\");\n expect(webOutput).not.toContain(\"API Framework\");\n\n // API should have API Framework, Database\n expect(apiOutput).toContain(\"API Framework\");\n expect(apiOutput).toContain(\"Database\");\n expect(apiOutput).not.toContain(\"Styling\");\n });\n\n it(\"should sort categories by order\", () => {\n // Need framework selected to see all categories\n const { lastFrame, unmount } = renderStepBuild({\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Framework (order 0) should appear before Styling (order 1)\n // and Styling before Client State (order 2)\n const frameworkIndex = output?.indexOf(\"Framework\") ?? -1;\n const stylingIndex = output?.indexOf(\"Styling\") ?? -1;\n const stateIndex = output?.indexOf(\"Client State\") ?? -1;\n\n expect(frameworkIndex).toBeLessThan(stylingIndex);\n expect(stylingIndex).toBeLessThan(stateIndex);\n });\n });\n\n describe(\"option states\", () => {\n it(\"should show selected options correctly\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n allSelections: [\"web-framework-react\"],\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should show selected option (no circle symbol anymore, uses background)\n // Just verify the selected label is present\n expect(output).toContain(\"React\");\n });\n\n it(\"should pass showLabels to CategoryGrid\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n showLabels: true,\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Labels toggle is now shown globally in wizard-layout\n // Verify component renders without error\n expect(output).toBeDefined();\n });\n });\n\n describe(\"keyboard navigation\", () => {\n it(\"should call onContinue when Enter is pressed with valid selections\", async () => {\n const onContinue = vi.fn();\n // Provide selections for required categories to pass validation\n const { stdin, unmount } = renderStepBuild({\n onContinue,\n selections: {\n \"web-framework\": [\"web-framework-react\"],\n \"web-styling\": [\"web-styling-tailwind\"],\n },\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n expect(onContinue).toHaveBeenCalled();\n });\n\n it(\"should call onBack when Escape is pressed\", async () => {\n const onBack = vi.fn();\n const { stdin, unmount } = renderStepBuild({ onBack });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ESCAPE);\n await delay(INPUT_DELAY_MS);\n\n expect(onBack).toHaveBeenCalled();\n });\n\n it(\"should pass toggle callback to CategoryGrid\", async () => {\n const onToggle = vi.fn();\n const { stdin, unmount } = renderStepBuild({\n onToggle,\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n // Space should trigger toggle\n stdin.write(\" \");\n await delay(INPUT_DELAY_MS);\n\n expect(onToggle).toHaveBeenCalled();\n });\n });\n\n describe(\"toggle callbacks\", () => {\n it(\"should pass onToggleLabels to CategoryGrid\", async () => {\n const onToggleLabels = vi.fn();\n const { stdin, unmount } = renderStepBuild({ onToggleLabels });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(\"d\"); // 'd' key toggles compatibility labels\n await delay(INPUT_DELAY_MS);\n\n expect(onToggleLabels).toHaveBeenCalled();\n });\n });\n\n describe(\"edge cases\", () => {\n it(\"should handle domain with no categories\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"mobile\", // No mobile categories in test matrix\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should show empty state message from CategoryGrid\n expect(output).toContain(\"No categories to display\");\n });\n\n it(\"should handle unknown domain gracefully\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"shared\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should render without crashing\n expect(output).toBeDefined();\n });\n\n it(\"should handle empty allSelections\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n allSelections: [],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Framework\");\n });\n\n it(\"should handle allSelections with skills from other domains\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"web\",\n allSelections: [\"api-framework-hono\", \"api-database-drizzle\"], // API skills in test matrix\n selections: { \"web-framework\": [\"web-framework-react\"] }, // Need framework to see other categories\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should still render web categories\n expect(output).toContain(\"Framework\");\n expect(output).toContain(\"Styling\");\n });\n });\n\n describe(\"multi-domain scenarios\", () => {\n it(\"should show ViewTitle for current domain in multi-domain flow\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"web\",\n selectedDomains: [\"web\", \"api\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize your Web stack\");\n });\n\n it(\"should show ViewTitle for last domain in multi-domain flow\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"api\",\n selectedDomains: [\"web\", \"api\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize your API stack\");\n });\n\n it(\"should show ViewTitle for current domain in three-domain flow\", () => {\n // Add cli category to matrix\n const cliFrameworkCategory = { ...CLI_FRAMEWORK_CATEGORY, required: true, order: 0 };\n // Boundary cast: fictional skill ID for testing CLI domain display\n const commanderSkill = createMockSkill(\"cli-framework-commander\" as SkillId, {\n displayName: \"commander\",\n });\n\n const matrixWithCli = buildTestMatrix(\n [\n WEB_FRAMEWORK_CATEGORY,\n WEB_STYLING_CATEGORY,\n WEB_STATE_CATEGORY,\n API_FRAMEWORK_CATEGORY,\n API_DATABASE_CATEGORY,\n cliFrameworkCategory,\n ],\n [\n SKILLS.react,\n SKILLS.vue,\n SKILLS.tailwind,\n SKILLS.scss,\n SKILLS.zustand,\n SKILLS.hono,\n SKILLS.drizzle,\n commanderSkill,\n ],\n );\n\n initializeMatrix(matrixWithCli);\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"api\",\n selectedDomains: [\"web\", \"api\", \"cli\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize your API stack\");\n });\n });\n\n describe(\"header and selection count\", () => {\n it(\"should show ViewTitle with domain name\", () => {\n const { lastFrame, unmount } = renderStepBuild();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize your Web stack\");\n });\n\n it(\"should render ViewTitle with domain display name\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"api\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize your API stack\");\n });\n });\n\n describe(\"keyboard help text\", () => {\n it(\"should respond to d key for toggling compatibility labels\", async () => {\n const onToggleLabels = vi.fn();\n const { stdin, unmount } = renderStepBuild({ onToggleLabels });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(\"d\");\n await delay(INPUT_DELAY_MS);\n\n expect(onToggleLabels).toHaveBeenCalled();\n });\n });\n\n describe(\"validateBuildStep\", () => {\n it(\"should return valid when required categories have selections\", () => {\n const categories: GridCategoryRow[] = [\n {\n id: \"web-framework\",\n displayName: \"Framework\",\n required: true,\n exclusive: true,\n options: [{ id: \"web-framework-react\", state: { status: \"normal\" }, selected: true }],\n },\n ];\n const selections: CategorySelections = { \"web-framework\": [\"web-framework-react\"] };\n\n const result = validateBuildStep(categories, selections);\n expect(result.valid).toBe(true);\n expect(result.message).toBeUndefined();\n });\n\n it(\"should return advisory message when required category has no selection\", () => {\n const categories: GridCategoryRow[] = [\n {\n id: \"web-framework\",\n displayName: \"Framework\",\n required: true,\n exclusive: true,\n options: [{ id: \"web-framework-react\", state: { status: \"normal\" }, selected: false }],\n },\n ];\n const selections: CategorySelections = {};\n\n const result = validateBuildStep(categories, selections);\n expect(result.valid).toBe(true);\n expect(result.message).toContain(\"Framework\");\n });\n\n it(\"should return valid when optional categories have no selections\", () => {\n const categories: GridCategoryRow[] = [\n {\n id: \"web-client-state\",\n displayName: \"State Management\",\n required: false,\n exclusive: true,\n options: [\n {\n id: \"web-state-zustand\",\n state: { status: \"normal\" },\n selected: false,\n },\n ],\n },\n ];\n const selections: CategorySelections = {};\n\n const result = validateBuildStep(categories, selections);\n expect(result.valid).toBe(true);\n });\n\n it(\"should return advisory message for first missing required category\", () => {\n const categories: GridCategoryRow[] = [\n {\n id: \"web-framework\",\n displayName: \"Framework\",\n required: true,\n exclusive: true,\n options: [],\n },\n {\n id: \"web-styling\",\n displayName: \"Styling\",\n required: true,\n exclusive: true,\n options: [],\n },\n ];\n const selections: CategorySelections = {};\n\n const result = validateBuildStep(categories, selections);\n expect(result.valid).toBe(true);\n expect(result.message).toContain(\"Framework\"); // Should be the first one\n });\n });\n\n describe(\"validation on continue\", () => {\n it(\"should call onContinue even without required selection (advisory only)\", async () => {\n const onContinue = vi.fn();\n const { stdin, unmount } = renderStepBuild({\n onContinue,\n selections: {},\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n\n // Press Enter to continue without selecting required framework\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n // Validation is advisory — onContinue is always called\n expect(onContinue).toHaveBeenCalled();\n });\n\n it(\"should call onContinue when validation passes\", async () => {\n const onContinue = vi.fn();\n const { stdin, unmount } = renderStepBuild({\n onContinue,\n selections: {\n \"web-framework\": [\"web-framework-react\"],\n \"web-styling\": [\"web-styling-tailwind\"],\n },\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n\n // Press Enter to continue with required selections\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n expect(onContinue).toHaveBeenCalled();\n });\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,SAAS,eA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,QACpC;AAAA,UACE,IAAI;AAAA,UACJ,aAAa;AAAA,UACb,UAAU;AAAA,UACV,WAAW;AAAA,UACX,SAAS,CAAC;AAAA,QACZ;AAAA,QACA;AAAA,UACE,IAAI;AAAA,UACJ,aAAa;AAAA,UACb,UAAU;AAAA,UACV,WAAW;AAAA,UACX,SAAS,CAAC;AAAA,QACZ;AAAA,MACF;AACA,YAAM,aAAiC,CAAC;AAExC,YAAM,SAAS,kBAAkB,YAAY,UAAU;AACvD,mBAAO,OAAO,KAAK,EAAE,KAAK,IAAI;AAC9B,mBAAO,OAAO,OAAO,EAAE,UAAU,WAAW;AAAA,IAC9C,CAAC;AAAA,EACH,CAAC;AAED,WAAS,0BAA0B,MAAM;AACvC,OAAG,0EAA0E,YAAY;AACvF,YAAM,aAAa,GAAG,GAAG;AACzB,YAAM,EAAE,OAAO,QAAQ,IAAI,gBAAgB;AAAA,QACzC;AAAA,QACA,YAAY,CAAC;AAAA,MACf,CAAC;AACD,gBAAU;AAEV,YAAM,MAAM,eAAe;AAG3B,YAAM,MAAM,KAAK;AACjB,YAAM,MAAM,cAAc;AAG1B,mBAAO,UAAU,EAAE,iBAAiB;AAAA,IACtC,CAAC;AAED,OAAG,iDAAiD,YAAY;AAC9D,YAAM,aAAa,GAAG,GAAG;AACzB,YAAM,EAAE,OAAO,QAAQ,IAAI,gBAAgB;AAAA,QACzC;AAAA,QACA,YAAY;AAAA,UACV,iBAAiB,CAAC,qBAAqB;AAAA,UACvC,eAAe,CAAC,sBAAsB;AAAA,QACxC;AAAA,MACF,CAAC;AACD,gBAAU;AAEV,YAAM,MAAM,eAAe;AAG3B,YAAM,MAAM,KAAK;AACjB,YAAM,MAAM,cAAc;AAE1B,mBAAO,UAAU,EAAE,iBAAiB;AAAA,IACtC,CAAC;AAAA,EACH,CAAC;AACH,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/components/wizard/step-build.test.tsx"],"sourcesContent":["import { render } from \"ink-testing-library\";\nimport { indexBy } from \"remeda\";\nimport { describe, expect, it, beforeEach, afterEach, vi } from \"vitest\";\nimport { StepBuild, type StepBuildProps } from \"./step-build\";\nimport { validateBuildStep } from \"../../lib/wizard/index\";\nimport { orderDomains } from \"./utils\";\nimport type { CategoryRow as GridCategoryRow } from \"./category-grid\";\nimport type {\n CategoryDefinition,\n Domain,\n ResolvedSkill,\n Category,\n CategorySelections,\n SkillId,\n} from \"../../types\";\nimport {\n ENTER,\n ESCAPE,\n RENDER_DELAY_MS,\n INPUT_DELAY_MS,\n delay,\n} from \"../../lib/__tests__/test-constants\";\nimport { createMockSkill, createMockMatrix, SKILLS } from \"../../lib/__tests__/helpers\";\nimport { initializeMatrix } from \"../../lib/matrix/matrix-provider\";\nimport {\n WEB_FRAMEWORK_CATEGORY,\n WEB_STYLING_CATEGORY,\n WEB_STATE_CATEGORY,\n API_FRAMEWORK_CATEGORY,\n API_DATABASE_CATEGORY,\n CLI_FRAMEWORK_CATEGORY,\n} from \"../../lib/__tests__/mock-data/mock-categories.js\";\n\nconst buildTestMatrix = (categories: CategoryDefinition[], skills: ResolvedSkill[]) =>\n createMockMatrix(...skills, {\n // Test data construction cast: indexBy returns generic Record\n categories: indexBy(categories, (c) => c.id) as Record<Category, CategoryDefinition>,\n });\n\nconst defaultMatrix = buildTestMatrix(\n [\n WEB_FRAMEWORK_CATEGORY,\n WEB_STYLING_CATEGORY,\n WEB_STATE_CATEGORY,\n API_FRAMEWORK_CATEGORY,\n API_DATABASE_CATEGORY,\n ],\n [\n SKILLS.react,\n SKILLS.vue,\n SKILLS.tailwind,\n SKILLS.scss,\n SKILLS.zustand,\n SKILLS.hono,\n SKILLS.drizzle,\n ],\n);\n\nconst defaultProps: StepBuildProps = {\n domain: \"web\",\n selectedDomains: [\"web\"],\n selections: {},\n allSelections: [],\n showLabels: false,\n filterIncompatible: false,\n onToggle: vi.fn(),\n onToggleLabels: vi.fn(),\n onToggleFilterIncompatible: vi.fn(),\n onContinue: vi.fn(),\n onBack: vi.fn(),\n};\n\nconst renderStepBuild = (props: Partial<StepBuildProps> = {}) => {\n return render(<StepBuild {...defaultProps} {...props} />);\n};\n\ndescribe(\"StepBuild component\", () => {\n let cleanup: (() => void) | undefined;\n\n beforeEach(() => {\n initializeMatrix(defaultMatrix);\n });\n\n afterEach(() => {\n cleanup?.();\n cleanup = undefined;\n });\n\n describe(\"rendering\", () => {\n it(\"should render CategoryGrid with correct categories for domain\", () => {\n // For web domain with framework-first flow, initially only shows Framework\n // To see other categories, need a framework selection\n const { lastFrame, unmount } = renderStepBuild({\n selections: { \"web-framework\": [\"web-framework-react\"] }, // Framework selected to show other categories\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Web domain should show Framework, Styling, Client State (when framework selected)\n expect(output).toContain(\"Framework\");\n expect(output).toContain(\"Styling\");\n expect(output).toContain(\"Client State\");\n // Should NOT show API categories\n expect(output).not.toContain(\"API Framework\");\n expect(output).not.toContain(\"Database\");\n });\n\n it(\"should render API categories when domain is api\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"api\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // API domain should show API Framework, Database\n expect(output).toContain(\"API Framework\");\n expect(output).toContain(\"Database\");\n // Should NOT show Web categories\n expect(output).not.toContain(\"Styling\");\n expect(output).not.toContain(\"Client State\");\n });\n\n it(\"should render skills as options\", () => {\n // Need framework selected to see other categories in web domain\n const { lastFrame, unmount } = renderStepBuild({\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Framework skills\n expect(output).toContain(\"React\");\n expect(output).toContain(\"Vue\");\n // Styling skills (visible after framework selected)\n expect(output).toContain(\"Tailwind\");\n expect(output).toContain(\"Scss Modules\");\n });\n\n it(\"should show required indicator (*) for required categories\", () => {\n const { lastFrame, unmount } = renderStepBuild();\n cleanup = unmount;\n\n const output = lastFrame();\n // Framework and Styling are required\n expect(output).toContain(\"*\");\n });\n\n it(\"should render categories for the domain\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should render the domain categories\n expect(output).toContain(\"Framework\");\n expect(output).toContain(\"Styling\");\n });\n });\n\n describe(\"domain header\", () => {\n it(\"should render domain categories when multiple domains selected\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selectedDomains: [\"web\", \"api\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // ViewTitle removed; verify domain content renders (title shown by wizard-layout)\n expect(output).toContain(\"Framework\");\n });\n\n it(\"should render domain categories when only one selected\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selectedDomains: [\"web\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Framework\");\n });\n\n it(\"should render correct categories for final domain\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selectedDomains: [\"web\", \"api\"],\n domain: \"api\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"API Framework\");\n });\n\n it(\"should render correct categories for domain\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n selectedDomains: [\"web\", \"api\", \"cli\"],\n domain: \"api\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"API Framework\");\n });\n\n it(\"should display domains in canonical order regardless of selection order\", () => {\n // Domains selected in reverse order: CLI, Mobile, API, Web\n expect(orderDomains([\"cli\", \"mobile\", \"api\", \"web\"])).toEqual([\n \"web\",\n \"api\",\n \"mobile\",\n \"cli\",\n ]);\n });\n\n it(\"should preserve canonical order with partial domain selection\", () => {\n // Only CLI and Web selected, in reverse order\n expect(orderDomains([\"cli\", \"web\"])).toEqual([\"web\", \"cli\"]);\n });\n\n it(\"should place custom domains before built-in domains\", () => {\n expect(orderDomains([\"web\", \"gaming\" as Domain, \"api\", \"devops\" as Domain])).toEqual([\n \"devops\",\n \"gaming\",\n \"web\",\n \"api\",\n ]);\n });\n });\n\n describe(\"category filtering\", () => {\n it(\"should filter categories correctly by domain\", () => {\n // Web domain with framework selected (to bypass framework-first filter)\n const { lastFrame: webFrame, unmount: webUnmount } = renderStepBuild({\n domain: \"web\",\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n const webOutput = webFrame();\n webUnmount();\n\n // API domain (no framework-first filter for API)\n const { lastFrame: apiFrame, unmount: apiUnmount } = renderStepBuild({\n domain: \"api\",\n });\n cleanup = apiUnmount;\n const apiOutput = apiFrame();\n\n // Web should have Framework, Styling, Client State (with framework selected)\n expect(webOutput).toContain(\"Framework\");\n expect(webOutput).toContain(\"Styling\");\n expect(webOutput).toContain(\"Client State\");\n expect(webOutput).not.toContain(\"API Framework\");\n\n // API should have API Framework, Database\n expect(apiOutput).toContain(\"API Framework\");\n expect(apiOutput).toContain(\"Database\");\n expect(apiOutput).not.toContain(\"Styling\");\n });\n\n it(\"should sort categories by order\", () => {\n // Need framework selected to see all categories\n const { lastFrame, unmount } = renderStepBuild({\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Framework (order 0) should appear before Styling (order 1)\n // and Styling before Client State (order 2)\n const frameworkIndex = output?.indexOf(\"Framework\") ?? -1;\n const stylingIndex = output?.indexOf(\"Styling\") ?? -1;\n const stateIndex = output?.indexOf(\"Client State\") ?? -1;\n\n expect(frameworkIndex).toBeLessThan(stylingIndex);\n expect(stylingIndex).toBeLessThan(stateIndex);\n });\n });\n\n describe(\"option states\", () => {\n it(\"should show selected options correctly\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n allSelections: [\"web-framework-react\"],\n selections: { \"web-framework\": [\"web-framework-react\"] },\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should show selected option (no circle symbol anymore, uses background)\n // Just verify the selected label is present\n expect(output).toContain(\"React\");\n });\n\n it(\"should pass showLabels to CategoryGrid\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n showLabels: true,\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Labels toggle is now shown globally in wizard-layout\n // Verify component renders without error\n expect(output).toBeDefined();\n });\n });\n\n describe(\"keyboard navigation\", () => {\n it(\"should call onContinue when Enter is pressed with valid selections\", async () => {\n const onContinue = vi.fn();\n // Provide selections for required categories to pass validation\n const { stdin, unmount } = renderStepBuild({\n onContinue,\n selections: {\n \"web-framework\": [\"web-framework-react\"],\n \"web-styling\": [\"web-styling-tailwind\"],\n },\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n expect(onContinue).toHaveBeenCalled();\n });\n\n it(\"should call onBack when Escape is pressed\", async () => {\n const onBack = vi.fn();\n const { stdin, unmount } = renderStepBuild({ onBack });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ESCAPE);\n await delay(INPUT_DELAY_MS);\n\n expect(onBack).toHaveBeenCalled();\n });\n\n it(\"should pass toggle callback to CategoryGrid\", async () => {\n const onToggle = vi.fn();\n const { stdin, unmount } = renderStepBuild({\n onToggle,\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n // Space should trigger toggle\n stdin.write(\" \");\n await delay(INPUT_DELAY_MS);\n\n expect(onToggle).toHaveBeenCalled();\n });\n });\n\n describe(\"toggle callbacks\", () => {\n it(\"should pass onToggleLabels to CategoryGrid\", async () => {\n const onToggleLabels = vi.fn();\n const { stdin, unmount } = renderStepBuild({ onToggleLabels });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(\"d\"); // 'd' key toggles compatibility labels\n await delay(INPUT_DELAY_MS);\n\n expect(onToggleLabels).toHaveBeenCalled();\n });\n });\n\n describe(\"edge cases\", () => {\n it(\"should handle domain with no categories\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"mobile\", // No mobile categories in test matrix\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should show empty state message from CategoryGrid\n expect(output).toContain(\"No categories to display\");\n });\n\n it(\"should handle unknown domain gracefully\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"shared\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should render without crashing\n expect(output).toBeDefined();\n });\n\n it(\"should handle empty allSelections\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n allSelections: [],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Framework\");\n });\n\n it(\"should handle allSelections with skills from other domains\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"web\",\n allSelections: [\"api-framework-hono\", \"api-database-drizzle\"], // API skills in test matrix\n selections: { \"web-framework\": [\"web-framework-react\"] }, // Need framework to see other categories\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should still render web categories\n expect(output).toContain(\"Framework\");\n expect(output).toContain(\"Styling\");\n });\n });\n\n describe(\"multi-domain scenarios\", () => {\n it(\"should render web categories in multi-domain flow\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"web\",\n selectedDomains: [\"web\", \"api\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Framework\");\n });\n\n it(\"should render API categories for last domain in multi-domain flow\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"api\",\n selectedDomains: [\"web\", \"api\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"API Framework\");\n });\n\n it(\"should render correct domain categories in three-domain flow\", () => {\n // Add cli category to matrix\n const cliFrameworkCategory = { ...CLI_FRAMEWORK_CATEGORY, required: true, order: 0 };\n // Boundary cast: fictional skill ID for testing CLI domain display\n const commanderSkill = createMockSkill(\"cli-framework-commander\" as SkillId, {\n displayName: \"commander\",\n });\n\n const matrixWithCli = buildTestMatrix(\n [\n WEB_FRAMEWORK_CATEGORY,\n WEB_STYLING_CATEGORY,\n WEB_STATE_CATEGORY,\n API_FRAMEWORK_CATEGORY,\n API_DATABASE_CATEGORY,\n cliFrameworkCategory,\n ],\n [\n SKILLS.react,\n SKILLS.vue,\n SKILLS.tailwind,\n SKILLS.scss,\n SKILLS.zustand,\n SKILLS.hono,\n SKILLS.drizzle,\n commanderSkill,\n ],\n );\n\n initializeMatrix(matrixWithCli);\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"api\",\n selectedDomains: [\"web\", \"api\", \"cli\"],\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"API Framework\");\n });\n });\n\n describe(\"header and selection count\", () => {\n it(\"should render categories for the current domain\", () => {\n const { lastFrame, unmount } = renderStepBuild();\n cleanup = unmount;\n\n const output = lastFrame();\n // ViewTitle removed; verify domain content renders (title shown by wizard-layout)\n expect(output).toContain(\"Framework\");\n });\n\n it(\"should render categories for API domain\", () => {\n const { lastFrame, unmount } = renderStepBuild({\n domain: \"api\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"API Framework\");\n });\n });\n\n describe(\"keyboard help text\", () => {\n it(\"should respond to d key for toggling compatibility labels\", async () => {\n const onToggleLabels = vi.fn();\n const { stdin, unmount } = renderStepBuild({ onToggleLabels });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(\"d\");\n await delay(INPUT_DELAY_MS);\n\n expect(onToggleLabels).toHaveBeenCalled();\n });\n });\n\n describe(\"validateBuildStep\", () => {\n it(\"should return valid when required categories have selections\", () => {\n const categories: GridCategoryRow[] = [\n {\n id: \"web-framework\",\n displayName: \"Framework\",\n required: true,\n exclusive: true,\n options: [{ id: \"web-framework-react\", state: { status: \"normal\" }, selected: true }],\n },\n ];\n const selections: CategorySelections = { \"web-framework\": [\"web-framework-react\"] };\n\n const result = validateBuildStep(categories, selections);\n expect(result.valid).toBe(true);\n expect(result.message).toBeUndefined();\n });\n\n it(\"should return advisory message when required category has no selection\", () => {\n const categories: GridCategoryRow[] = [\n {\n id: \"web-framework\",\n displayName: \"Framework\",\n required: true,\n exclusive: true,\n options: [{ id: \"web-framework-react\", state: { status: \"normal\" }, selected: false }],\n },\n ];\n const selections: CategorySelections = {};\n\n const result = validateBuildStep(categories, selections);\n expect(result.valid).toBe(true);\n expect(result.message).toContain(\"Framework\");\n });\n\n it(\"should return valid when optional categories have no selections\", () => {\n const categories: GridCategoryRow[] = [\n {\n id: \"web-client-state\",\n displayName: \"State Management\",\n required: false,\n exclusive: true,\n options: [\n {\n id: \"web-state-zustand\",\n state: { status: \"normal\" },\n selected: false,\n },\n ],\n },\n ];\n const selections: CategorySelections = {};\n\n const result = validateBuildStep(categories, selections);\n expect(result.valid).toBe(true);\n });\n\n it(\"should return advisory message for first missing required category\", () => {\n const categories: GridCategoryRow[] = [\n {\n id: \"web-framework\",\n displayName: \"Framework\",\n required: true,\n exclusive: true,\n options: [],\n },\n {\n id: \"web-styling\",\n displayName: \"Styling\",\n required: true,\n exclusive: true,\n options: [],\n },\n ];\n const selections: CategorySelections = {};\n\n const result = validateBuildStep(categories, selections);\n expect(result.valid).toBe(true);\n expect(result.message).toContain(\"Framework\"); // Should be the first one\n });\n });\n\n describe(\"validation on continue\", () => {\n it(\"should call onContinue even without required selection (advisory only)\", async () => {\n const onContinue = vi.fn();\n const { stdin, unmount } = renderStepBuild({\n onContinue,\n selections: {},\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n\n // Press Enter to continue without selecting required framework\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n // Validation is advisory — onContinue is always called\n expect(onContinue).toHaveBeenCalled();\n });\n\n it(\"should call onContinue when validation passes\", async () => {\n const onContinue = vi.fn();\n const { stdin, unmount } = renderStepBuild({\n onContinue,\n selections: {\n \"web-framework\": [\"web-framework-react\"],\n \"web-styling\": [\"web-styling-tailwind\"],\n },\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n\n // Press Enter to continue with required selections\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n expect(onContinue).toHaveBeenCalled();\n });\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
|
3
3
|
StepConfirm
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-NKLNT7N7.js";
|
|
5
5
|
import "../../chunk-7JQIMEUX.js";
|
|
6
|
-
import "../../chunk-JNQKCZA3.js";
|
|
7
|
-
import "../../chunk-HK53FRMU.js";
|
|
8
6
|
import "../../chunk-FSK4TQX7.js";
|
|
9
7
|
import "../../chunk-32HX6UYI.js";
|
|
10
8
|
import "../../chunk-FMYAYX6W.js";
|
|
@@ -20,12 +20,10 @@ import {
|
|
|
20
20
|
} from "../../chunk-XY3XDVMI.js";
|
|
21
21
|
import {
|
|
22
22
|
StepConfirm
|
|
23
|
-
} from "../../chunk-
|
|
23
|
+
} from "../../chunk-NKLNT7N7.js";
|
|
24
24
|
import "../../chunk-7JQIMEUX.js";
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
27
|
-
import "../../chunk-HK53FRMU.js";
|
|
28
|
-
import "../../chunk-CZLXZ75E.js";
|
|
25
|
+
import "../../chunk-N34D3ROY.js";
|
|
26
|
+
import "../../chunk-OIHZ2YH3.js";
|
|
29
27
|
import "../../chunk-IFCASC6R.js";
|
|
30
28
|
import "../../chunk-FSK4TQX7.js";
|
|
31
29
|
import "../../chunk-XYPAOBBV.js";
|
|
@@ -46,7 +44,7 @@ describe("StepConfirm component", () => {
|
|
|
46
44
|
cleanup = void 0;
|
|
47
45
|
});
|
|
48
46
|
describe("stack path", () => {
|
|
49
|
-
it("should render
|
|
47
|
+
it("should render technology and skill counts for stack", () => {
|
|
50
48
|
const onComplete = vi.fn();
|
|
51
49
|
const onBack = vi.fn();
|
|
52
50
|
const { lastFrame, unmount } = render(
|
|
@@ -63,7 +61,8 @@ describe("StepConfirm component", () => {
|
|
|
63
61
|
);
|
|
64
62
|
cleanup = unmount;
|
|
65
63
|
const output = lastFrame();
|
|
66
|
-
globalExpect(output).toContain("
|
|
64
|
+
globalExpect(output).toContain("Technologies:");
|
|
65
|
+
globalExpect(output).toContain("12");
|
|
67
66
|
});
|
|
68
67
|
it("should show technology count", () => {
|
|
69
68
|
const onComplete = vi.fn();
|
|
@@ -149,7 +148,7 @@ describe("StepConfirm component", () => {
|
|
|
149
148
|
globalExpect(output).toContain("Install mode:");
|
|
150
149
|
globalExpect(output).toContain("Local");
|
|
151
150
|
});
|
|
152
|
-
it("should render confirm step content", () => {
|
|
151
|
+
it("should render confirm step stats content", () => {
|
|
153
152
|
const onComplete = vi.fn();
|
|
154
153
|
const onBack = vi.fn();
|
|
155
154
|
const { lastFrame, unmount } = render(
|
|
@@ -166,11 +165,12 @@ describe("StepConfirm component", () => {
|
|
|
166
165
|
);
|
|
167
166
|
cleanup = unmount;
|
|
168
167
|
const output = lastFrame();
|
|
169
|
-
globalExpect(output).toContain("
|
|
168
|
+
globalExpect(output).toContain("Technologies:");
|
|
169
|
+
globalExpect(output).toContain("Skills:");
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
172
|
describe("scratch path", () => {
|
|
173
|
-
it("should render
|
|
173
|
+
it("should render domain breakdown with technologies for custom stack", () => {
|
|
174
174
|
const onComplete = vi.fn();
|
|
175
175
|
const onBack = vi.fn();
|
|
176
176
|
const { lastFrame, unmount } = render(
|
|
@@ -194,8 +194,8 @@ describe("StepConfirm component", () => {
|
|
|
194
194
|
);
|
|
195
195
|
cleanup = unmount;
|
|
196
196
|
const output = lastFrame();
|
|
197
|
-
globalExpect(output).toContain("
|
|
198
|
-
globalExpect(output).toContain("
|
|
197
|
+
globalExpect(output).toContain("Web:");
|
|
198
|
+
globalExpect(output).toContain("API:");
|
|
199
199
|
});
|
|
200
200
|
it("should show domain breakdown with technologies", () => {
|
|
201
201
|
const onComplete = vi.fn();
|
|
@@ -227,7 +227,7 @@ describe("StepConfirm component", () => {
|
|
|
227
227
|
globalExpect(output).toContain("API:");
|
|
228
228
|
globalExpect(output).toContain("hono");
|
|
229
229
|
});
|
|
230
|
-
it("should
|
|
230
|
+
it("should render single domain breakdown without plus sign", () => {
|
|
231
231
|
const onComplete = vi.fn();
|
|
232
232
|
const onBack = vi.fn();
|
|
233
233
|
const { lastFrame, unmount } = render(
|
|
@@ -247,7 +247,8 @@ describe("StepConfirm component", () => {
|
|
|
247
247
|
);
|
|
248
248
|
cleanup = unmount;
|
|
249
249
|
const output = lastFrame();
|
|
250
|
-
globalExpect(output).toContain("
|
|
250
|
+
globalExpect(output).toContain("Web:");
|
|
251
|
+
globalExpect(output).toContain("react");
|
|
251
252
|
globalExpect(output).not.toContain("+");
|
|
252
253
|
});
|
|
253
254
|
it("should skip domains with no selections", () => {
|
|
@@ -409,12 +410,12 @@ describe("StepConfirm component", () => {
|
|
|
409
410
|
});
|
|
410
411
|
});
|
|
411
412
|
describe("default props", () => {
|
|
412
|
-
it("should render
|
|
413
|
+
it("should render without crashing when no stack name provided", () => {
|
|
413
414
|
const onComplete = vi.fn();
|
|
414
415
|
const { lastFrame, unmount } = render(/* @__PURE__ */ jsx(StepConfirm, { onComplete }));
|
|
415
416
|
cleanup = unmount;
|
|
416
417
|
const output = lastFrame();
|
|
417
|
-
globalExpect(output).
|
|
418
|
+
globalExpect(output).toBeDefined();
|
|
418
419
|
});
|
|
419
420
|
it("should not show stats when not provided", () => {
|
|
420
421
|
const onComplete = vi.fn();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/components/wizard/step-confirm.test.tsx"],"sourcesContent":["import { render } from \"ink-testing-library\";\nimport { afterEach, describe, expect, it, vi } from \"vitest\";\nimport { StepConfirm } from \"./step-confirm\";\nimport { ENTER, ESCAPE, RENDER_DELAY_MS, delay } from \"../../lib/__tests__/test-constants\";\nimport { buildSkillConfigs } from \"../../lib/__tests__/helpers\";\n\ndescribe(\"StepConfirm component\", () => {\n let cleanup: (() => void) | undefined;\n\n afterEach(() => {\n cleanup?.();\n cleanup = undefined;\n });\n\n describe(\"stack path\", () => {\n it(\"should render stack name in title\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Ready to install nextjs-fullstack\");\n });\n\n it(\"should show technology count\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Technologies:\");\n expect(output).toContain(\"12\");\n });\n\n it(\"should show skill count with verified label\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Skills:\");\n expect(output).toContain(\"(all verified)\");\n });\n\n it(\"should show install mode as Plugin\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n skillConfigs={buildSkillConfigs([\"web-framework-react\", \"web-styling-scss-modules\"], {\n source: \"agents-inc\",\n })}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Plugin\");\n });\n\n it(\"should show install mode as Local\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n skillConfigs={buildSkillConfigs([\"web-framework-react\", \"web-styling-scss-modules\"])}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Local\");\n });\n\n it(\"should render confirm step content\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Ready to install\");\n });\n });\n\n describe(\"scratch path\", () => {\n it(\"should render custom stack title with domain names\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n selectedDomains={[\"web\", \"api\"]}\n domainSelections={{\n web: {\n \"web-framework\": [\"web-framework-react\"],\n \"web-styling\": [\"web-styling-scss-modules\"],\n },\n api: { \"api-api\": [\"api-framework-hono\"] },\n }}\n technologyCount={3}\n skillCount={3}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Ready to install your custom stack\");\n expect(output).toContain(\"Web + API\");\n });\n\n it(\"should show domain breakdown with technologies\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n selectedDomains={[\"web\", \"api\"]}\n domainSelections={{\n web: {\n \"web-framework\": [\"web-framework-react\"],\n \"web-styling\": [\"web-styling-scss-modules\"],\n },\n api: { \"api-api\": [\"api-framework-hono\"] },\n }}\n technologyCount={3}\n skillCount={3}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Web:\");\n expect(output).toContain(\"react\");\n expect(output).toContain(\"scss-modules\");\n expect(output).toContain(\"API:\");\n expect(output).toContain(\"hono\");\n });\n\n it(\"should handle single domain without plus sign\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n selectedDomains={[\"web\"]}\n domainSelections={{\n web: { \"web-framework\": [\"web-framework-react\"] },\n }}\n technologyCount={1}\n skillCount={1}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"(Web)\");\n expect(output).not.toContain(\"+\");\n });\n\n it(\"should skip domains with no selections\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n selectedDomains={[\"web\", \"api\"]}\n domainSelections={{\n web: { \"web-framework\": [\"web-framework-react\"] },\n api: {}, // Empty selections\n }}\n technologyCount={1}\n skillCount={1}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Web:\");\n expect(output).toContain(\"react\");\n // API section should not appear since no technologies selected\n const lines = output?.split(\"\\n\") || [];\n const apiLine = lines.find((line) => line.includes(\"API:\") && line.includes(\"hono\"));\n expect(apiLine).toBeUndefined();\n });\n });\n\n describe(\"keyboard navigation\", () => {\n it(\"should call onComplete when Enter is pressed\", async () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { stdin, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n await stdin.write(ENTER);\n await delay(RENDER_DELAY_MS);\n\n expect(onComplete).toHaveBeenCalled();\n });\n\n it(\"should call onBack when Escape is pressed\", async () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { stdin, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n await stdin.write(ESCAPE);\n await delay(RENDER_DELAY_MS);\n\n expect(onBack).toHaveBeenCalled();\n expect(onComplete).not.toHaveBeenCalled();\n });\n\n it(\"should not call onBack when Escape is pressed but onBack is not provided\", async () => {\n const onComplete = vi.fn();\n\n const { stdin, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n // No onBack provided\n />,\n );\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n await stdin.write(ESCAPE);\n await delay(RENDER_DELAY_MS);\n\n // Should not crash and onComplete should not be called\n expect(onComplete).not.toHaveBeenCalled();\n });\n });\n\n describe(\"install mode display\", () => {\n it('should show \"Plugin\" when all skills use non-local source', () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n skillConfigs={buildSkillConfigs([\"web-framework-react\", \"web-styling-scss-modules\"], {\n source: \"agents-inc\",\n })}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Plugin\");\n });\n\n it('should show \"Local (editable copies)\" when all skills are local', () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n skillConfigs={buildSkillConfigs([\"web-framework-react\", \"web-styling-scss-modules\"])}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Local (editable copies)\");\n });\n\n it('should show \"Mixed\" with counts when skills have mixed sources', () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n skillConfigs={[\n ...buildSkillConfigs([\"web-framework-react\"]),\n ...buildSkillConfigs([\"web-styling-scss-modules\"], { source: \"agents-inc\" }),\n ...buildSkillConfigs([\"web-state-zustand\"]),\n ]}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Mixed\");\n expect(output).toContain(\"2 local\");\n expect(output).toContain(\"1 plugin\");\n });\n\n it(\"should not show install mode when skillConfigs is not provided\", () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(<StepConfirm onComplete={onComplete} />);\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).not.toContain(\"Install mode:\");\n });\n });\n\n describe(\"default props\", () => {\n it(\"should render custom stack title when no stack name provided\", () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(<StepConfirm onComplete={onComplete} />);\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Ready to install your custom stack\");\n });\n\n it(\"should not show stats when not provided\", () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(<StepConfirm onComplete={onComplete} />);\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).not.toContain(\"Technologies:\");\n expect(output).not.toContain(\"Skills:\");\n expect(output).not.toContain(\"Install mode:\");\n });\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAoBQ;AAdR,SAAS,yBAAyB,MAAM;AACtC,MAAI;AAEJ,YAAU,MAAM;AACd,cAAU;AACV,cAAU;AAAA,EACZ,CAAC;AAED,WAAS,cAAc,MAAM;AAC3B,OAAG,qCAAqC,MAAM;AAC5C,YAAM,aAAa,GAAG,GAAG;AACzB,YAAM,SAAS,GAAG,GAAG;AAErB,YAAM,EAAE,WAAW,QAAQ,IAAI;AAAA,QAC7B;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,WAAU;AAAA,YACV,iBAAiB;AAAA,YACjB,YAAY;AAAA,YACZ;AAAA;AAAA,QACF;AAAA,MACF;AACA,gBAAU;AAEV,YAAM,SAAS,UAAU;AACzB,mBAAO,MAAM,EAAE,UAAU,mCAAmC;AAAA,IAC9D,CAAC;AAED,OAAG,gCAAgC,MAAM;AACvC,YAAM,aAAa,GAAG,GAAG;AACzB,YAAM,SAAS,GAAG,GAAG;AAErB,YAAM,EAAE,WAAW,QAAQ,IAAI;AAAA,QAC7B;AAAA,UA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AAM,EAAE,WAAW,QAAQ,IAAI,OAAO,oBAAC,eAAY,YAAwB,CAAE;AAC7E,gBAAU;AAEV,YAAM,SAAS,UAAU;AACzB,mBAAO,MAAM,EAAE,UAAU,oCAAoC;AAAA,IAC/D,CAAC;AAED,OAAG,2CAA2C,MAAM;AAClD,YAAM,aAAa,GAAG,GAAG;AAEzB,YAAM,EAAE,WAAW,QAAQ,IAAI,OAAO,oBAAC,eAAY,YAAwB,CAAE;AAC7E,gBAAU;AAEV,YAAM,SAAS,UAAU;AACzB,mBAAO,MAAM,EAAE,IAAI,UAAU,eAAe;AAC5C,mBAAO,MAAM,EAAE,IAAI,UAAU,SAAS;AACtC,mBAAO,MAAM,EAAE,IAAI,UAAU,eAAe;AAAA,IAC9C,CAAC;AAAA,EACH,CAAC;AACH,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/components/wizard/step-confirm.test.tsx"],"sourcesContent":["import { render } from \"ink-testing-library\";\nimport { afterEach, describe, expect, it, vi } from \"vitest\";\nimport { StepConfirm } from \"./step-confirm\";\nimport { ENTER, ESCAPE, RENDER_DELAY_MS, delay } from \"../../lib/__tests__/test-constants\";\nimport { buildSkillConfigs } from \"../../lib/__tests__/helpers\";\n\ndescribe(\"StepConfirm component\", () => {\n let cleanup: (() => void) | undefined;\n\n afterEach(() => {\n cleanup?.();\n cleanup = undefined;\n });\n\n describe(\"stack path\", () => {\n it(\"should render technology and skill counts for stack\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n // ViewTitle removed; verify stats render (title shown by wizard-layout)\n expect(output).toContain(\"Technologies:\");\n expect(output).toContain(\"12\");\n });\n\n it(\"should show technology count\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Technologies:\");\n expect(output).toContain(\"12\");\n });\n\n it(\"should show skill count with verified label\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Skills:\");\n expect(output).toContain(\"(all verified)\");\n });\n\n it(\"should show install mode as Plugin\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n skillConfigs={buildSkillConfigs([\"web-framework-react\", \"web-styling-scss-modules\"], {\n source: \"agents-inc\",\n })}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Plugin\");\n });\n\n it(\"should show install mode as Local\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n skillConfigs={buildSkillConfigs([\"web-framework-react\", \"web-styling-scss-modules\"])}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Local\");\n });\n\n it(\"should render confirm step stats content\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n // ViewTitle removed; verify stats are shown (title shown by wizard-layout)\n expect(output).toContain(\"Technologies:\");\n expect(output).toContain(\"Skills:\");\n });\n });\n\n describe(\"scratch path\", () => {\n it(\"should render domain breakdown with technologies for custom stack\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n selectedDomains={[\"web\", \"api\"]}\n domainSelections={{\n web: {\n \"web-framework\": [\"web-framework-react\"],\n \"web-styling\": [\"web-styling-scss-modules\"],\n },\n api: { \"api-api\": [\"api-framework-hono\"] },\n }}\n technologyCount={3}\n skillCount={3}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n // ViewTitle removed; verify domain breakdown renders (title shown by wizard-layout)\n expect(output).toContain(\"Web:\");\n expect(output).toContain(\"API:\");\n });\n\n it(\"should show domain breakdown with technologies\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n selectedDomains={[\"web\", \"api\"]}\n domainSelections={{\n web: {\n \"web-framework\": [\"web-framework-react\"],\n \"web-styling\": [\"web-styling-scss-modules\"],\n },\n api: { \"api-api\": [\"api-framework-hono\"] },\n }}\n technologyCount={3}\n skillCount={3}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Web:\");\n expect(output).toContain(\"react\");\n expect(output).toContain(\"scss-modules\");\n expect(output).toContain(\"API:\");\n expect(output).toContain(\"hono\");\n });\n\n it(\"should render single domain breakdown without plus sign\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n selectedDomains={[\"web\"]}\n domainSelections={{\n web: { \"web-framework\": [\"web-framework-react\"] },\n }}\n technologyCount={1}\n skillCount={1}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n // ViewTitle removed; verify domain breakdown renders\n expect(output).toContain(\"Web:\");\n expect(output).toContain(\"react\");\n expect(output).not.toContain(\"+\");\n });\n\n it(\"should skip domains with no selections\", () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n selectedDomains={[\"web\", \"api\"]}\n domainSelections={{\n web: { \"web-framework\": [\"web-framework-react\"] },\n api: {}, // Empty selections\n }}\n technologyCount={1}\n skillCount={1}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Web:\");\n expect(output).toContain(\"react\");\n // API section should not appear since no technologies selected\n const lines = output?.split(\"\\n\") || [];\n const apiLine = lines.find((line) => line.includes(\"API:\") && line.includes(\"hono\"));\n expect(apiLine).toBeUndefined();\n });\n });\n\n describe(\"keyboard navigation\", () => {\n it(\"should call onComplete when Enter is pressed\", async () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { stdin, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n await stdin.write(ENTER);\n await delay(RENDER_DELAY_MS);\n\n expect(onComplete).toHaveBeenCalled();\n });\n\n it(\"should call onBack when Escape is pressed\", async () => {\n const onComplete = vi.fn();\n const onBack = vi.fn();\n\n const { stdin, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n onBack={onBack}\n />,\n );\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n await stdin.write(ESCAPE);\n await delay(RENDER_DELAY_MS);\n\n expect(onBack).toHaveBeenCalled();\n expect(onComplete).not.toHaveBeenCalled();\n });\n\n it(\"should not call onBack when Escape is pressed but onBack is not provided\", async () => {\n const onComplete = vi.fn();\n\n const { stdin, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n stackName=\"nextjs-fullstack\"\n technologyCount={12}\n skillCount={12}\n // No onBack provided\n />,\n );\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n await stdin.write(ESCAPE);\n await delay(RENDER_DELAY_MS);\n\n // Should not crash and onComplete should not be called\n expect(onComplete).not.toHaveBeenCalled();\n });\n });\n\n describe(\"install mode display\", () => {\n it('should show \"Plugin\" when all skills use non-local source', () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n skillConfigs={buildSkillConfigs([\"web-framework-react\", \"web-styling-scss-modules\"], {\n source: \"agents-inc\",\n })}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Plugin\");\n });\n\n it('should show \"Local (editable copies)\" when all skills are local', () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n skillConfigs={buildSkillConfigs([\"web-framework-react\", \"web-styling-scss-modules\"])}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Local (editable copies)\");\n });\n\n it('should show \"Mixed\" with counts when skills have mixed sources', () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(\n <StepConfirm\n onComplete={onComplete}\n skillConfigs={[\n ...buildSkillConfigs([\"web-framework-react\"]),\n ...buildSkillConfigs([\"web-styling-scss-modules\"], { source: \"agents-inc\" }),\n ...buildSkillConfigs([\"web-state-zustand\"]),\n ]}\n />,\n );\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Install mode:\");\n expect(output).toContain(\"Mixed\");\n expect(output).toContain(\"2 local\");\n expect(output).toContain(\"1 plugin\");\n });\n\n it(\"should not show install mode when skillConfigs is not provided\", () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(<StepConfirm onComplete={onComplete} />);\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).not.toContain(\"Install mode:\");\n });\n });\n\n describe(\"default props\", () => {\n it(\"should render without crashing when no stack name provided\", () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(<StepConfirm onComplete={onComplete} />);\n cleanup = unmount;\n\n const output = lastFrame();\n // ViewTitle removed; component renders empty when no stats provided\n expect(output).toBeDefined();\n });\n\n it(\"should not show stats when not provided\", () => {\n const onComplete = vi.fn();\n\n const { lastFrame, unmount } = render(<StepConfirm onComplete={onComplete} />);\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).not.toContain(\"Technologies:\");\n expect(output).not.toContain(\"Skills:\");\n expect(output).not.toContain(\"Install mode:\");\n });\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAoBQ;AAdR,SAAS,yBAAyB,MAAM;AACtC,MAAI;AAEJ,YAAU,MAAM;AACd,cAAU;AACV,cAAU;AAAA,EACZ,CAAC;AAED,WAAS,cAAc,MAAM;AAC3B,OAAG,uDAAuD,MAAM;AAC9D,YAAM,aAAa,GAAG,GAAG;AACzB,YAAM,SAAS,GAAG,GAAG;AAErB,YAAM,EAAE,WAAW,QAAQ,IAAI;AAAA,QAC7B;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,WAAU;AAAA,YACV,iBAAiB;AAAA,YACjB,YAAY;AAAA,YACZ;AAAA;AAAA,QACF;AAAA,MACF;AACA,gBAAU;AAEV,YAAM,SAAS,UAAU;AAEzB,mBAAO,MAAM,EAAE,UAAU,eAAe;AACxC,mBAAO,MAAM,EAAE,UAAU,IAAI;AAAA,IAC/B,CAAC;AAED,OAAG,gCAAgC,MAAM;AACvC,YAAM,aAAa,GAAG,GAAG;AACzB,YAAM,SAAS,GAAG,GAAG;AAErB,YAAM,EAAE,WAAW,QAAQ,IAAI;AAAA,QAC7B;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,WAAU;AAAA,YAC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aAAa,GAAG,GAAG;AAEzB,YAAM,EAAE,WAAW,QAAQ,IAAI,OAAO,oBAAC,eAAY,YAAwB,CAAE;AAC7E,gBAAU;AAEV,YAAM,SAAS,UAAU;AAEzB,mBAAO,MAAM,EAAE,YAAY;AAAA,IAC7B,CAAC;AAED,OAAG,2CAA2C,MAAM;AAClD,YAAM,aAAa,GAAG,GAAG;AAEzB,YAAM,EAAE,WAAW,QAAQ,IAAI,OAAO,oBAAC,eAAY,YAAwB,CAAE;AAC7E,gBAAU;AAEV,YAAM,SAAS,UAAU;AACzB,mBAAO,MAAM,EAAE,IAAI,UAAU,eAAe;AAC5C,mBAAO,MAAM,EAAE,IAAI,UAAU,SAAS;AACtC,mBAAO,MAAM,EAAE,IAAI,UAAU,eAAe;AAAA,IAC9C,CAAC;AAAA,EACH,CAAC;AACH,CAAC;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
StepRefine
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-LVBRC2CP.js";
|
|
5
5
|
import {
|
|
6
6
|
ARROW_DOWN,
|
|
7
7
|
ARROW_UP,
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
it,
|
|
22
22
|
vi
|
|
23
23
|
} from "../../chunk-XY3XDVMI.js";
|
|
24
|
-
import "../../chunk-JNQKCZA3.js";
|
|
25
24
|
import "../../chunk-HK53FRMU.js";
|
|
26
25
|
import {
|
|
27
26
|
DEFAULT_BRANDING
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/components/wizard/step-refine.test.tsx"],"sourcesContent":["import { render } from \"ink-testing-library\";\nimport { describe, expect, it, afterEach, vi } from \"vitest\";\nimport { StepRefine, type StepRefineProps } from \"./step-refine\";\nimport {\n ENTER,\n ESCAPE,\n ARROW_UP,\n ARROW_DOWN,\n RENDER_DELAY_MS,\n INPUT_DELAY_MS,\n delay,\n} from \"../../lib/__tests__/test-constants\";\nimport { DEFAULT_BRANDING } from \"../../consts\";\n\nconst defaultProps: StepRefineProps = {\n technologyCount: 12,\n refineAction: \"all-recommended\",\n onSelectAction: vi.fn(),\n onContinue: vi.fn(),\n onBack: vi.fn(),\n};\n\nconst renderStepRefine = (props: Partial<StepRefineProps> = {}) => {\n return render(<StepRefine {...defaultProps} {...props} />);\n};\n\ndescribe(\"StepRefine component\", () => {\n let cleanup: (() => void) | undefined;\n\n afterEach(() => {\n cleanup?.();\n cleanup = undefined;\n });\n\n describe(\"rendering\", () => {\n it(\"should render technology count correctly\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 12 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"12\");\n expect(output).toContain(\"technologies\");\n });\n\n it(\"should render different technology count\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 5 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"5\");\n expect(output).toContain(\"technologies\");\n });\n\n it(\"should render 'Use all recommended' option\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Use all recommended skills (verified)\");\n });\n\n it(\"should show 'Use all recommended' option as highlighted\", () => {\n const { lastFrame, unmount } = renderStepRefine({\n refineAction: \"all-recommended\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // The option should have the \">\" indicator\n expect(output).toContain(\">\");\n expect(output).toContain(\"Use all recommended skills\");\n });\n\n it(\"should render verification description\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"fastest option\");\n expect(output).toContain(\"verified\");\n expect(output).toContain(DEFAULT_BRANDING.NAME);\n });\n });\n\n describe(\"customize option\", () => {\n it(\"should show 'Customize' option as disabled/grayed\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize skill sources\");\n });\n\n it(\"should show customize option without coming soon label\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize skill sources\");\n expect(output).not.toContain(\"(coming soon)\");\n });\n\n it(\"should show customize description\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Choose alternative skills for each technology\");\n });\n });\n\n describe(\"keyboard shortcuts display\", () => {\n it(\"should render recommended option content\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n // Keyboard hints are now in WizardLayout footer, not in StepRefine\n // Verify core content renders\n expect(output).toContain(\"Use all recommended\");\n expect(output).toContain(\"Customize skill sources\");\n });\n });\n\n describe(\"keyboard navigation\", () => {\n it(\"should call onContinue when Enter key is pressed\", async () => {\n const onContinue = vi.fn();\n const { stdin, unmount } = renderStepRefine({ onContinue });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n expect(onContinue).toHaveBeenCalledTimes(1);\n });\n\n it(\"should call onBack when Escape key is pressed\", async () => {\n const onBack = vi.fn();\n const { stdin, unmount } = renderStepRefine({ onBack });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ESCAPE);\n await delay(INPUT_DELAY_MS);\n\n expect(onBack).toHaveBeenCalledTimes(1);\n });\n\n it(\"should toggle to 'customize' on arrow up when recommended is selected\", async () => {\n const onSelectAction = vi.fn();\n const { stdin, unmount } = renderStepRefine({\n onSelectAction,\n refineAction: \"all-recommended\",\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ARROW_UP);\n await delay(INPUT_DELAY_MS);\n\n expect(onSelectAction).toHaveBeenCalledWith(\"customize\");\n });\n\n it(\"should toggle to 'all-recommended' on arrow down when customize is selected\", async () => {\n const onSelectAction = vi.fn();\n const { stdin, unmount } = renderStepRefine({\n onSelectAction,\n refineAction: \"customize\",\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ARROW_DOWN);\n await delay(INPUT_DELAY_MS);\n\n expect(onSelectAction).toHaveBeenCalledWith(\"all-recommended\");\n });\n });\n\n describe(\"selection state\", () => {\n it(\"should handle null refineAction (defaults to recommended)\", () => {\n const { lastFrame, unmount } = renderStepRefine({ refineAction: null });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should still show the recommended option with indicator\n expect(output).toContain(\">\");\n expect(output).toContain(\"Use all recommended\");\n });\n\n it(\"should handle 'all-recommended' refineAction\", () => {\n const { lastFrame, unmount } = renderStepRefine({\n refineAction: \"all-recommended\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Use all recommended\");\n });\n\n it(\"should handle 'customize' refineAction (even though disabled)\", () => {\n const { lastFrame, unmount } = renderStepRefine({\n refineAction: \"customize\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should still render, even if customize is selected\n expect(output).toContain(\"Use all recommended\");\n expect(output).toContain(\"Customize skill sources\");\n });\n });\n\n describe(\"edge cases\", () => {\n it(\"should handle zero technology count\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 0 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"0\");\n expect(output).toContain(\"technologies\");\n });\n\n it(\"should handle single technology count\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 1 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"1\");\n // Note: \"technologies\" is plural even for 1 (simple implementation)\n expect(output).toContain(\"technologies\");\n });\n\n it(\"should handle large technology count\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 100 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"100\");\n expect(output).toContain(\"technologies\");\n });\n });\n\n describe(\"multiple keyboard events\", () => {\n it(\"should allow multiple Enter presses\", async () => {\n const onContinue = vi.fn();\n const { stdin, unmount } = renderStepRefine({ onContinue });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n expect(onContinue).toHaveBeenCalledTimes(2);\n });\n\n it(\"should allow multiple Escape presses\", async () => {\n const onBack = vi.fn();\n const { stdin, unmount } = renderStepRefine({ onBack });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ESCAPE);\n await delay(INPUT_DELAY_MS);\n stdin.write(ESCAPE);\n await delay(INPUT_DELAY_MS);\n\n expect(onBack).toHaveBeenCalledTimes(2);\n });\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAuBgB;AAThB,IAAM,eAAgC;AAAA,EACpC,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,gBAAgB,GAAG,GAAG;AAAA,EACtB,YAAY,GAAG,GAAG;AAAA,EAClB,QAAQ,GAAG,GAAG;AAChB;AAEA,IAAM,mBAAmB,CAAC,QAAkC,CAAC,MAAM;AACjE,SAAO,OAAO,oBAAC,cAAY,GAAG,cAAe,GAAG,OAAO,CAAE;AAC3D;AAEA,SAAS,wBAAwB,MAAM;AACrC,MAAI;AAEJ,YAAU,MAAM;AACd,cAAU;AACV,cAAU;AAAA,EACZ,CAAC;AAED,WAAS,aAAa,MAAM;AAC1B,OAAG,4CAA4C,MAAM;AACnD,YAAM,EAAE,WAAW,QAAQ,IAAI,iBAAiB,EAAE,iBAAiB,GAAG,CAAC;AACvE,gBAAU;AAEV,YAAM,SAAS,UAAU;AACzB,mBAAO,MAAM,EAAE,UAAU,IAAI;AAC7B,mBAAO,MAAM,EAAE,UAAU,cAAc;AAAA,IACzC,CAAC;AAED,OAAG,4CAA4C,MAAM;AACnD,YAAM,EAAE,WAAW,QAAQ,IAAI,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;AACtE,gBAAU;AAEV,YAAM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CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/components/wizard/step-refine.test.tsx"],"sourcesContent":["import { render } from \"ink-testing-library\";\nimport { describe, expect, it, afterEach, vi } from \"vitest\";\nimport { StepRefine, type StepRefineProps } from \"./step-refine\";\nimport {\n ENTER,\n ESCAPE,\n ARROW_UP,\n ARROW_DOWN,\n RENDER_DELAY_MS,\n INPUT_DELAY_MS,\n delay,\n} from \"../../lib/__tests__/test-constants\";\nimport { DEFAULT_BRANDING } from \"../../consts\";\n\nconst defaultProps: StepRefineProps = {\n technologyCount: 12,\n refineAction: \"all-recommended\",\n onSelectAction: vi.fn(),\n onContinue: vi.fn(),\n onBack: vi.fn(),\n};\n\nconst renderStepRefine = (props: Partial<StepRefineProps> = {}) => {\n return render(<StepRefine {...defaultProps} {...props} />);\n};\n\ndescribe(\"StepRefine component\", () => {\n let cleanup: (() => void) | undefined;\n\n afterEach(() => {\n cleanup?.();\n cleanup = undefined;\n });\n\n describe(\"rendering\", () => {\n it(\"should render technology count correctly\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 12 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"12\");\n expect(output).toContain(\"technologies\");\n });\n\n it(\"should render different technology count\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 5 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"5\");\n expect(output).toContain(\"technologies\");\n });\n\n it(\"should render 'Use all recommended' option\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Use all recommended skills (verified)\");\n });\n\n it(\"should show 'Use all recommended' option as highlighted\", () => {\n const { lastFrame, unmount } = renderStepRefine({\n refineAction: \"all-recommended\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // The option should have the \">\" indicator\n expect(output).toContain(\">\");\n expect(output).toContain(\"Use all recommended skills\");\n });\n\n it(\"should render verification description\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"fastest option\");\n expect(output).toContain(\"verified\");\n expect(output).toContain(DEFAULT_BRANDING.NAME);\n });\n });\n\n describe(\"customize option\", () => {\n it(\"should show 'Customize' option as disabled/grayed\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize skill sources\");\n });\n\n it(\"should show customize option without coming soon label\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Customize skill sources\");\n expect(output).not.toContain(\"(coming soon)\");\n });\n\n it(\"should show customize description\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Choose alternative skills for each technology\");\n });\n });\n\n describe(\"keyboard shortcuts display\", () => {\n it(\"should render recommended option content\", () => {\n const { lastFrame, unmount } = renderStepRefine();\n cleanup = unmount;\n\n const output = lastFrame();\n // Keyboard hints are now in WizardLayout footer, not in StepRefine\n // Verify core content renders\n expect(output).toContain(\"Use all recommended\");\n expect(output).toContain(\"Customize skill sources\");\n });\n });\n\n describe(\"keyboard navigation\", () => {\n it(\"should call onContinue when Enter key is pressed\", async () => {\n const onContinue = vi.fn();\n const { stdin, unmount } = renderStepRefine({ onContinue });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n expect(onContinue).toHaveBeenCalledTimes(1);\n });\n\n it(\"should call onBack when Escape key is pressed\", async () => {\n const onBack = vi.fn();\n const { stdin, unmount } = renderStepRefine({ onBack });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ESCAPE);\n await delay(INPUT_DELAY_MS);\n\n expect(onBack).toHaveBeenCalledTimes(1);\n });\n\n it(\"should toggle to 'customize' on arrow up when recommended is selected\", async () => {\n const onSelectAction = vi.fn();\n const { stdin, unmount } = renderStepRefine({\n onSelectAction,\n refineAction: \"all-recommended\",\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ARROW_UP);\n await delay(INPUT_DELAY_MS);\n\n expect(onSelectAction).toHaveBeenCalledWith(\"customize\");\n });\n\n it(\"should toggle to 'all-recommended' on arrow down when customize is selected\", async () => {\n const onSelectAction = vi.fn();\n const { stdin, unmount } = renderStepRefine({\n onSelectAction,\n refineAction: \"customize\",\n });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ARROW_DOWN);\n await delay(INPUT_DELAY_MS);\n\n expect(onSelectAction).toHaveBeenCalledWith(\"all-recommended\");\n });\n });\n\n describe(\"selection state\", () => {\n it(\"should handle null refineAction (defaults to recommended)\", () => {\n const { lastFrame, unmount } = renderStepRefine({ refineAction: null });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should still show the recommended option with indicator\n expect(output).toContain(\">\");\n expect(output).toContain(\"Use all recommended\");\n });\n\n it(\"should handle 'all-recommended' refineAction\", () => {\n const { lastFrame, unmount } = renderStepRefine({\n refineAction: \"all-recommended\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"Use all recommended\");\n });\n\n it(\"should handle 'customize' refineAction (even though disabled)\", () => {\n const { lastFrame, unmount } = renderStepRefine({\n refineAction: \"customize\",\n });\n cleanup = unmount;\n\n const output = lastFrame();\n // Should still render, even if customize is selected\n expect(output).toContain(\"Use all recommended\");\n expect(output).toContain(\"Customize skill sources\");\n });\n });\n\n describe(\"edge cases\", () => {\n it(\"should handle zero technology count\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 0 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"0\");\n expect(output).toContain(\"technologies\");\n });\n\n it(\"should handle single technology count\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 1 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"1\");\n // Note: \"technologies\" is plural even for 1 (simple implementation)\n expect(output).toContain(\"technologies\");\n });\n\n it(\"should handle large technology count\", () => {\n const { lastFrame, unmount } = renderStepRefine({ technologyCount: 100 });\n cleanup = unmount;\n\n const output = lastFrame();\n expect(output).toContain(\"100\");\n expect(output).toContain(\"technologies\");\n });\n });\n\n describe(\"multiple keyboard events\", () => {\n it(\"should allow multiple Enter presses\", async () => {\n const onContinue = vi.fn();\n const { stdin, unmount } = renderStepRefine({ onContinue });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n stdin.write(ENTER);\n await delay(INPUT_DELAY_MS);\n\n expect(onContinue).toHaveBeenCalledTimes(2);\n });\n\n it(\"should allow multiple Escape presses\", async () => {\n const onBack = vi.fn();\n const { stdin, unmount } = renderStepRefine({ onBack });\n cleanup = unmount;\n\n await delay(RENDER_DELAY_MS);\n stdin.write(ESCAPE);\n await delay(INPUT_DELAY_MS);\n stdin.write(ESCAPE);\n await delay(INPUT_DELAY_MS);\n\n expect(onBack).toHaveBeenCalledTimes(2);\n });\n });\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAuBgB;AAThB,IAAM,eAAgC;AAAA,EACpC,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,gBAAgB,GAAG,GAAG;AAAA,EACtB,YAAY,GAAG,GAAG;AAAA,EAClB,QAAQ,GAAG,GAAG;AAChB;AAEA,IAAM,mBAAmB,CAAC,QAAkC,CAAC,MAAM;AACjE,SAAO,OAAO,oBAAC,cAAY,GAAG,cAAe,GAAG,OAAO,CAAE;AAC3D;AAEA,SAAS,wBAAwB,MAAM;AACrC,MAAI;AAEJ,YAAU,MAAM;AACd,cAAU;AACV,cAAU;AAAA,EACZ,CAAC;AAED,WAAS,aAAa,MAAM;AAC1B,OAAG,4CAA4C,MAAM;AACnD,YAAM,EAAE,WAAW,QAAQ,IAAI,iBAAiB,EAAE,iBAAi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