@vived/app 6.6.0 → 6.7.1
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/dist/cjs/BaseApp/UC/RenderCanvasUC.js +17 -36
- package/dist/cjs/BaseApp/UC/RenderCanvasUC.js.map +1 -1
- package/dist/cjs/BaseApp/UC/RenderCanvasUC.test.js +18 -18
- package/dist/cjs/BaseApp/UC/RenderCanvasUC.test.js.map +1 -1
- package/dist/cjs/Challenge/Factories/ChallengeFeatureFactory.js +9 -28
- package/dist/cjs/Challenge/Factories/ChallengeFeatureFactory.js.map +1 -1
- package/dist/cjs/Challenge/Factories/ChallengeFeatureFactory.test.js +51 -0
- package/dist/cjs/Challenge/Factories/ChallengeFeatureFactory.test.js.map +1 -0
- package/dist/cjs/EventSystem/Entities/EventEntity.js +12 -2
- package/dist/cjs/EventSystem/Entities/EventEntity.js.map +1 -1
- package/dist/cjs/EventSystem/Entities/EventEntity.test.js +45 -0
- package/dist/cjs/EventSystem/Entities/EventEntity.test.js.map +1 -1
- package/dist/cjs/EventSystem/Mocks/MockEventEntity.js +7 -2
- package/dist/cjs/EventSystem/Mocks/MockEventEntity.js.map +1 -1
- package/dist/cjs/EventSystem/types.js.map +1 -1
- package/dist/cjs/ObjectPick/Factories/setupObjectPick.js +18 -1
- package/dist/cjs/ObjectPick/Factories/setupObjectPick.js.map +1 -1
- package/dist/cjs/ObjectPick/Factories/setupObjectPick.test.js +55 -0
- package/dist/cjs/ObjectPick/Factories/setupObjectPick.test.js.map +1 -0
- package/dist/cjs/Procedure/Adapters/procedureAdapter.js +1 -0
- package/dist/cjs/Procedure/Adapters/procedureAdapter.js.map +1 -1
- package/dist/cjs/Procedure/Adapters/procedureAdapter.test.js +1 -0
- package/dist/cjs/Procedure/Adapters/procedureAdapter.test.js.map +1 -1
- package/dist/cjs/Procedure/Adapters/procedureAuthoringAdapter.js +2 -0
- package/dist/cjs/Procedure/Adapters/procedureAuthoringAdapter.js.map +1 -1
- package/dist/cjs/Procedure/Adapters/procedureAuthoringAdapter.test.js +3 -0
- package/dist/cjs/Procedure/Adapters/procedureAuthoringAdapter.test.js.map +1 -1
- package/dist/cjs/Procedure/Adapters/procedureHintAdapter.test.js +1 -0
- package/dist/cjs/Procedure/Adapters/procedureHintAdapter.test.js.map +1 -1
- package/dist/cjs/Procedure/Adapters/procedureProgressAdapter.js +2 -0
- package/dist/cjs/Procedure/Adapters/procedureProgressAdapter.js.map +1 -1
- package/dist/cjs/Procedure/Adapters/procedureProgressAdapter.test.js +3 -0
- package/dist/cjs/Procedure/Adapters/procedureProgressAdapter.test.js.map +1 -1
- package/dist/cjs/Procedure/Adapters/procedureQuizResultAdapter.js +2 -0
- package/dist/cjs/Procedure/Adapters/procedureQuizResultAdapter.js.map +1 -1
- package/dist/cjs/Procedure/Adapters/procedureQuizResultAdapter.test.js +3 -0
- package/dist/cjs/Procedure/Adapters/procedureQuizResultAdapter.test.js.map +1 -1
- package/dist/cjs/Procedure/Entities/ProcedureEntity.js +163 -24
- package/dist/cjs/Procedure/Entities/ProcedureEntity.js.map +1 -1
- package/dist/cjs/Procedure/Entities/ProcedureEntity.test.js +240 -0
- package/dist/cjs/Procedure/Entities/ProcedureEntity.test.js.map +1 -1
- package/dist/cjs/Procedure/Factories/ProcedureFeatureFactory.js +20 -0
- package/dist/cjs/Procedure/Factories/ProcedureFeatureFactory.js.map +1 -1
- package/dist/cjs/Procedure/Factories/ProcedureFeatureFactory.test.js +25 -0
- package/dist/cjs/Procedure/Factories/ProcedureFeatureFactory.test.js.map +1 -1
- package/dist/cjs/Procedure/Mocks/MockProcedureEntity.js +2 -0
- package/dist/cjs/Procedure/Mocks/MockProcedureEntity.js.map +1 -1
- package/dist/cjs/Procedure/PM/ProcedurePM.js +13 -1
- package/dist/cjs/Procedure/PM/ProcedurePM.js.map +1 -1
- package/dist/cjs/Procedure/PM/ProcedurePM.test.js +34 -0
- package/dist/cjs/Procedure/PM/ProcedurePM.test.js.map +1 -1
- package/dist/cjs/Procedure/UCs/UpdateProcedureEventsUCHook.test.js +3 -0
- package/dist/cjs/Procedure/UCs/UpdateProcedureEventsUCHook.test.js.map +1 -1
- package/dist/cjs/Procedure/types.js.map +1 -1
- package/dist/cjs/TouchController/UC/UpdateTouchInoutBound.test.js +37 -0
- package/dist/cjs/TouchController/UC/UpdateTouchInoutBound.test.js.map +1 -1
- package/dist/cjs/TouchController/UC/UpdateTouchInputBound.js +17 -4
- package/dist/cjs/TouchController/UC/UpdateTouchInputBound.js.map +1 -1
- package/dist/esm/BaseApp/UC/RenderCanvasUC.js +17 -36
- package/dist/esm/BaseApp/UC/RenderCanvasUC.js.map +1 -1
- package/dist/esm/BaseApp/UC/RenderCanvasUC.test.js +18 -18
- package/dist/esm/BaseApp/UC/RenderCanvasUC.test.js.map +1 -1
- package/dist/esm/Challenge/Factories/ChallengeFeatureFactory.js +9 -28
- package/dist/esm/Challenge/Factories/ChallengeFeatureFactory.js.map +1 -1
- package/dist/esm/Challenge/Factories/ChallengeFeatureFactory.test.js +49 -0
- package/dist/esm/Challenge/Factories/ChallengeFeatureFactory.test.js.map +1 -0
- package/dist/esm/EventSystem/Entities/EventEntity.js +12 -2
- package/dist/esm/EventSystem/Entities/EventEntity.js.map +1 -1
- package/dist/esm/EventSystem/Entities/EventEntity.test.js +45 -0
- package/dist/esm/EventSystem/Entities/EventEntity.test.js.map +1 -1
- package/dist/esm/EventSystem/Mocks/MockEventEntity.js +7 -2
- package/dist/esm/EventSystem/Mocks/MockEventEntity.js.map +1 -1
- package/dist/esm/EventSystem/types.js.map +1 -1
- package/dist/esm/ObjectPick/Factories/setupObjectPick.js +18 -1
- package/dist/esm/ObjectPick/Factories/setupObjectPick.js.map +1 -1
- package/dist/esm/ObjectPick/Factories/setupObjectPick.test.js +53 -0
- package/dist/esm/ObjectPick/Factories/setupObjectPick.test.js.map +1 -0
- package/dist/esm/Procedure/Adapters/procedureAdapter.js +1 -0
- package/dist/esm/Procedure/Adapters/procedureAdapter.js.map +1 -1
- package/dist/esm/Procedure/Adapters/procedureAdapter.test.js +1 -0
- package/dist/esm/Procedure/Adapters/procedureAdapter.test.js.map +1 -1
- package/dist/esm/Procedure/Adapters/procedureAuthoringAdapter.js +2 -0
- package/dist/esm/Procedure/Adapters/procedureAuthoringAdapter.js.map +1 -1
- package/dist/esm/Procedure/Adapters/procedureAuthoringAdapter.test.js +3 -0
- package/dist/esm/Procedure/Adapters/procedureAuthoringAdapter.test.js.map +1 -1
- package/dist/esm/Procedure/Adapters/procedureHintAdapter.test.js +1 -0
- package/dist/esm/Procedure/Adapters/procedureHintAdapter.test.js.map +1 -1
- package/dist/esm/Procedure/Adapters/procedureProgressAdapter.js +2 -0
- package/dist/esm/Procedure/Adapters/procedureProgressAdapter.js.map +1 -1
- package/dist/esm/Procedure/Adapters/procedureProgressAdapter.test.js +3 -0
- package/dist/esm/Procedure/Adapters/procedureProgressAdapter.test.js.map +1 -1
- package/dist/esm/Procedure/Adapters/procedureQuizResultAdapter.js +2 -0
- package/dist/esm/Procedure/Adapters/procedureQuizResultAdapter.js.map +1 -1
- package/dist/esm/Procedure/Adapters/procedureQuizResultAdapter.test.js +3 -0
- package/dist/esm/Procedure/Adapters/procedureQuizResultAdapter.test.js.map +1 -1
- package/dist/esm/Procedure/Entities/ProcedureEntity.js +163 -24
- package/dist/esm/Procedure/Entities/ProcedureEntity.js.map +1 -1
- package/dist/esm/Procedure/Entities/ProcedureEntity.test.js +240 -0
- package/dist/esm/Procedure/Entities/ProcedureEntity.test.js.map +1 -1
- package/dist/esm/Procedure/Factories/ProcedureFeatureFactory.js +20 -0
- package/dist/esm/Procedure/Factories/ProcedureFeatureFactory.js.map +1 -1
- package/dist/esm/Procedure/Factories/ProcedureFeatureFactory.test.js +26 -1
- package/dist/esm/Procedure/Factories/ProcedureFeatureFactory.test.js.map +1 -1
- package/dist/esm/Procedure/Mocks/MockProcedureEntity.js +2 -0
- package/dist/esm/Procedure/Mocks/MockProcedureEntity.js.map +1 -1
- package/dist/esm/Procedure/PM/ProcedurePM.js +13 -1
- package/dist/esm/Procedure/PM/ProcedurePM.js.map +1 -1
- package/dist/esm/Procedure/PM/ProcedurePM.test.js +34 -0
- package/dist/esm/Procedure/PM/ProcedurePM.test.js.map +1 -1
- package/dist/esm/Procedure/UCs/UpdateProcedureEventsUCHook.test.js +3 -0
- package/dist/esm/Procedure/UCs/UpdateProcedureEventsUCHook.test.js.map +1 -1
- package/dist/esm/Procedure/types.js.map +1 -1
- package/dist/esm/TouchController/UC/UpdateTouchInoutBound.test.js +37 -0
- package/dist/esm/TouchController/UC/UpdateTouchInoutBound.test.js.map +1 -1
- package/dist/esm/TouchController/UC/UpdateTouchInputBound.js +17 -4
- package/dist/esm/TouchController/UC/UpdateTouchInputBound.js.map +1 -1
- package/dist/types/Challenge/Factories/ChallengeFeatureFactory.d.ts +7 -16
- package/dist/types/Challenge/Factories/ChallengeFeatureFactory.d.ts.map +1 -1
- package/dist/types/Challenge/Factories/ChallengeFeatureFactory.test.d.ts +2 -0
- package/dist/types/Challenge/Factories/ChallengeFeatureFactory.test.d.ts.map +1 -0
- package/dist/types/EventSystem/Entities/EventEntity.d.ts +13 -2
- package/dist/types/EventSystem/Entities/EventEntity.d.ts.map +1 -1
- package/dist/types/EventSystem/Mocks/MockEventEntity.d.ts +3 -2
- package/dist/types/EventSystem/Mocks/MockEventEntity.d.ts.map +1 -1
- package/dist/types/EventSystem/types.d.ts +23 -0
- package/dist/types/EventSystem/types.d.ts.map +1 -1
- package/dist/types/ObjectPick/Factories/setupObjectPick.d.ts +10 -0
- package/dist/types/ObjectPick/Factories/setupObjectPick.d.ts.map +1 -1
- package/dist/types/ObjectPick/Factories/setupObjectPick.test.d.ts +2 -0
- package/dist/types/ObjectPick/Factories/setupObjectPick.test.d.ts.map +1 -0
- package/dist/types/Procedure/Adapters/procedureAdapter.d.ts.map +1 -1
- package/dist/types/Procedure/Adapters/procedureAuthoringAdapter.d.ts.map +1 -1
- package/dist/types/Procedure/Adapters/procedureProgressAdapter.d.ts.map +1 -1
- package/dist/types/Procedure/Adapters/procedureQuizResultAdapter.d.ts.map +1 -1
- package/dist/types/Procedure/Entities/ProcedureEntity.d.ts +10 -0
- package/dist/types/Procedure/Entities/ProcedureEntity.d.ts.map +1 -1
- package/dist/types/Procedure/Factories/ProcedureFeatureFactory.d.ts +6 -0
- package/dist/types/Procedure/Factories/ProcedureFeatureFactory.d.ts.map +1 -1
- package/dist/types/Procedure/Mocks/MockProcedureEntity.d.ts +3 -0
- package/dist/types/Procedure/Mocks/MockProcedureEntity.d.ts.map +1 -1
- package/dist/types/Procedure/types.d.ts +17 -1
- package/dist/types/Procedure/types.d.ts.map +1 -1
- package/dist/types/TouchController/UC/UpdateTouchInputBound.d.ts +11 -0
- package/dist/types/TouchController/UC/UpdateTouchInputBound.d.ts.map +1 -1
- package/package.json +6 -3
- package/src/EventSystem/CONTEXT.md +29 -17
- package/dist/cjs/FramedScreen/Factories/setupStandardFramedScreen.test.js +0 -31
- package/dist/cjs/FramedScreen/Factories/setupStandardFramedScreen.test.js.map +0 -1
- package/dist/cjs/StateMachine/Controller/clickRestoreScene.js +0 -14
- package/dist/cjs/StateMachine/Controller/clickRestoreScene.js.map +0 -1
- package/dist/cjs/StateMachine/Controller/clickRestoreScene.test.js +0 -26
- package/dist/cjs/StateMachine/Controller/clickRestoreScene.test.js.map +0 -1
- package/dist/cjs/TestUtils/index.js +0 -18
- package/dist/cjs/TestUtils/index.js.map +0 -1
- package/dist/cjs/TestUtils/setupFeatureForTesting.js +0 -60
- package/dist/cjs/TestUtils/setupFeatureForTesting.js.map +0 -1
- package/dist/esm/FramedScreen/Factories/setupStandardFramedScreen.test.js +0 -29
- package/dist/esm/FramedScreen/Factories/setupStandardFramedScreen.test.js.map +0 -1
- package/dist/esm/StateMachine/Controller/clickRestoreScene.js +0 -11
- package/dist/esm/StateMachine/Controller/clickRestoreScene.js.map +0 -1
- package/dist/esm/StateMachine/Controller/clickRestoreScene.test.js +0 -24
- package/dist/esm/StateMachine/Controller/clickRestoreScene.test.js.map +0 -1
- package/dist/esm/TestUtils/index.js +0 -2
- package/dist/esm/TestUtils/index.js.map +0 -1
- package/dist/esm/TestUtils/setupFeatureForTesting.js +0 -57
- package/dist/esm/TestUtils/setupFeatureForTesting.js.map +0 -1
- package/dist/types/FramedScreen/Factories/setupStandardFramedScreen.test.d.ts +0 -2
- package/dist/types/FramedScreen/Factories/setupStandardFramedScreen.test.d.ts.map +0 -1
- package/dist/types/StateMachine/Controller/clickRestoreScene.d.ts +0 -3
- package/dist/types/StateMachine/Controller/clickRestoreScene.d.ts.map +0 -1
- package/dist/types/StateMachine/Controller/clickRestoreScene.test.d.ts +0 -2
- package/dist/types/StateMachine/Controller/clickRestoreScene.test.d.ts.map +0 -1
- package/dist/types/TestUtils/index.d.ts +0 -2
- package/dist/types/TestUtils/index.d.ts.map +0 -1
- package/dist/types/TestUtils/setupFeatureForTesting.d.ts +0 -48
- package/dist/types/TestUtils/setupFeatureForTesting.d.ts.map +0 -1
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* setupFeatureForTesting.ts
|
|
4
|
-
*
|
|
5
|
-
* The feature-context test harness for this Feature Library.
|
|
6
|
-
*
|
|
7
|
-
* This package has no app-level domain (no `makeDomain`, no single repo), so there is no
|
|
8
|
-
* global "make the domain" harness. The unit of test context is a **Feature** (or a small
|
|
9
|
-
* cluster of Features), wired the way a Slide App wires it — through each Feature's
|
|
10
|
-
* `FeatureFactory` (the current standard), using the same phased orchestration production
|
|
11
|
-
* uses. See `CLAUDE.md` and `docs/agents/domain.md`.
|
|
12
|
-
*
|
|
13
|
-
* Use this for **wiring / lifecycle** tests — proving that a Feature, once really wired,
|
|
14
|
-
* behaves end-to-end (e.g. a Challenge submits its result when the student leaves the slide).
|
|
15
|
-
* For pure **logic** tests of a single UC or PM, a hand-wired `makeAppObjectRepo()` rig with
|
|
16
|
-
* the collaborators mocked at the boundary is lighter and still preferred — see
|
|
17
|
-
* `src/ObjectPick/UseCases/TrySubmitObjectPickUC.test.ts` as the reference.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* // LabelDrop's submit path depends on Challenge (for `selectedChallenge`) and the
|
|
21
|
-
* // Dispatcher (the Host boundary). List dependencies first, exactly as a Slide App would.
|
|
22
|
-
* const { appObjects } = setupFeatureForTesting([
|
|
23
|
-
* makeDispatcherFeatureFactory,
|
|
24
|
-
* makeChallengeFeatureFactory,
|
|
25
|
-
* makeLabelDropFeatureFactory,
|
|
26
|
-
* ]);
|
|
27
|
-
* // Then act through a Controller / navigation seam and assert through an Adapter VM or a
|
|
28
|
-
* // dispatcher mock registered before setup.
|
|
29
|
-
*/
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.setupFeatureForTesting = setupFeatureForTesting;
|
|
32
|
-
const core_1 = require("@vived/core");
|
|
33
|
-
/**
|
|
34
|
-
* Wire one or more Features into a fresh repo for a feature-context test.
|
|
35
|
-
*
|
|
36
|
-
* @param featureFactories The `make<Feature>FeatureFactory` functions to wire, in the order a
|
|
37
|
-
* Slide App would compose them — a Feature whose `finalSetup` depends on another Feature's
|
|
38
|
-
* entities must be listed *after* that Feature.
|
|
39
|
-
* @param seed Optional callback run *before* the factories are constructed. Use it to stand up
|
|
40
|
-
* the boundary singletons a Feature reads at construction time (many Feature UCs resolve
|
|
41
|
-
* siblings via `getCachedSingleton`, which THROWS when absent — e.g. `BaseAppState`,
|
|
42
|
-
* `ChallengeEntity`). Seed real entities or their Mocks here instead of pulling every
|
|
43
|
-
* dependency Feature's factory into the cluster.
|
|
44
|
-
* @returns `{ appObjects }` — resolve Controllers and Adapters from it to act and assert.
|
|
45
|
-
*/
|
|
46
|
-
function setupFeatureForTesting(featureFactories, seed) {
|
|
47
|
-
const appObjects = (0, core_1.makeAppObjectRepo)();
|
|
48
|
-
// The DomainFactoryRepo must exist before the factories are constructed: each
|
|
49
|
-
// FeatureFactory auto-registers with it in its constructor.
|
|
50
|
-
const factoryRepo = (0, core_1.makeDomainFactoryRepo)(appObjects);
|
|
51
|
-
// Stand up boundary singletons the Features read at construction time.
|
|
52
|
-
if (seed)
|
|
53
|
-
seed(appObjects);
|
|
54
|
-
featureFactories.forEach((makeFactory) => makeFactory(appObjects));
|
|
55
|
-
// Run the same phased orchestration as production — all setupEntities, then all setupUCs,
|
|
56
|
-
// then all setupPMs, then all finalSetup — so cross-Feature dependencies resolve correctly.
|
|
57
|
-
factoryRepo.setupDomain();
|
|
58
|
-
return { appObjects };
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=setupFeatureForTesting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupFeatureForTesting.js","sourceRoot":"","sources":["../../../src/TestUtils/setupFeatureForTesting.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;;AA2BH,wDAoBC;AA7CD,sCAKqB;AAOrB;;;;;;;;;;;;GAYG;AACH,SAAgB,sBAAsB,CACpC,gBAAkE,EAClE,IAA0C;IAE1C,MAAM,UAAU,GAAG,IAAA,wBAAiB,GAAE,CAAC;IAEvC,8EAA8E;IAC9E,4DAA4D;IAC5D,MAAM,WAAW,GAAG,IAAA,4BAAqB,EAAC,UAAU,CAAC,CAAC;IAEtD,uEAAuE;IACvE,IAAI,IAAI;QAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAE3B,gBAAgB,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;IAEnE,0FAA0F;IAC1F,4FAA4F;IAC5F,WAAW,CAAC,WAAW,EAAE,CAAC;IAE1B,OAAO,EAAE,UAAU,EAAE,CAAC;AACxB,CAAC","sourcesContent":["/**\r\n * setupFeatureForTesting.ts\r\n *\r\n * The feature-context test harness for this Feature Library.\r\n *\r\n * This package has no app-level domain (no `makeDomain`, no single repo), so there is no\r\n * global \"make the domain\" harness. The unit of test context is a **Feature** (or a small\r\n * cluster of Features), wired the way a Slide App wires it — through each Feature's\r\n * `FeatureFactory` (the current standard), using the same phased orchestration production\r\n * uses. See `CLAUDE.md` and `docs/agents/domain.md`.\r\n *\r\n * Use this for **wiring / lifecycle** tests — proving that a Feature, once really wired,\r\n * behaves end-to-end (e.g. a Challenge submits its result when the student leaves the slide).\r\n * For pure **logic** tests of a single UC or PM, a hand-wired `makeAppObjectRepo()` rig with\r\n * the collaborators mocked at the boundary is lighter and still preferred — see\r\n * `src/ObjectPick/UseCases/TrySubmitObjectPickUC.test.ts` as the reference.\r\n *\r\n * @example\r\n * // LabelDrop's submit path depends on Challenge (for `selectedChallenge`) and the\r\n * // Dispatcher (the Host boundary). List dependencies first, exactly as a Slide App would.\r\n * const { appObjects } = setupFeatureForTesting([\r\n * makeDispatcherFeatureFactory,\r\n * makeChallengeFeatureFactory,\r\n * makeLabelDropFeatureFactory,\r\n * ]);\r\n * // Then act through a Controller / navigation seam and assert through an Adapter VM or a\r\n * // dispatcher mock registered before setup.\r\n */\r\n\r\nimport {\r\n AppObjectRepo,\r\n DomainFactory,\r\n makeAppObjectRepo,\r\n makeDomainFactoryRepo,\r\n} from \"@vived/core\";\r\n\r\nexport interface FeatureTestContext {\r\n /** The live repo, wired through the given FeatureFactories exactly as production does. */\r\n appObjects: AppObjectRepo;\r\n}\r\n\r\n/**\r\n * Wire one or more Features into a fresh repo for a feature-context test.\r\n *\r\n * @param featureFactories The `make<Feature>FeatureFactory` functions to wire, in the order a\r\n * Slide App would compose them — a Feature whose `finalSetup` depends on another Feature's\r\n * entities must be listed *after* that Feature.\r\n * @param seed Optional callback run *before* the factories are constructed. Use it to stand up\r\n * the boundary singletons a Feature reads at construction time (many Feature UCs resolve\r\n * siblings via `getCachedSingleton`, which THROWS when absent — e.g. `BaseAppState`,\r\n * `ChallengeEntity`). Seed real entities or their Mocks here instead of pulling every\r\n * dependency Feature's factory into the cluster.\r\n * @returns `{ appObjects }` — resolve Controllers and Adapters from it to act and assert.\r\n */\r\nexport function setupFeatureForTesting(\r\n featureFactories: ((appObjects: AppObjectRepo) => DomainFactory)[],\r\n seed?: (appObjects: AppObjectRepo) => void,\r\n): FeatureTestContext {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n // The DomainFactoryRepo must exist before the factories are constructed: each\r\n // FeatureFactory auto-registers with it in its constructor.\r\n const factoryRepo = makeDomainFactoryRepo(appObjects);\r\n\r\n // Stand up boundary singletons the Features read at construction time.\r\n if (seed) seed(appObjects);\r\n\r\n featureFactories.forEach((makeFactory) => makeFactory(appObjects));\r\n\r\n // Run the same phased orchestration as production — all setupEntities, then all setupUCs,\r\n // then all setupPMs, then all finalSetup — so cross-Feature dependencies resolve correctly.\r\n factoryRepo.setupDomain();\r\n\r\n return { appObjects };\r\n}\r\n"]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { makeAppObjectRepo } from "@vived/core";
|
|
2
|
-
import { setupStandardFramedScreen } from "./setupStandardFramedScreen";
|
|
3
|
-
describe("setupStandardFramedScreen", () => {
|
|
4
|
-
it("Defaults to adding the StandardLayoutUC", () => {
|
|
5
|
-
const appObjects = makeAppObjectRepo();
|
|
6
|
-
const ao = setupStandardFramedScreen(appObjects);
|
|
7
|
-
expect(ao.hasComponent("StandardLayoutUC")).toBe(true);
|
|
8
|
-
});
|
|
9
|
-
it("Does not add the StandardLayoutUC if the option is set to true", () => {
|
|
10
|
-
const appObjects = makeAppObjectRepo();
|
|
11
|
-
const ao = setupStandardFramedScreen(appObjects, {
|
|
12
|
-
dontSetupLayoutHook: true,
|
|
13
|
-
});
|
|
14
|
-
expect(ao.hasComponent("StandardLayoutUC")).toBe(false);
|
|
15
|
-
});
|
|
16
|
-
it("Adds the StandardLayoutUC if the option is set to false", () => {
|
|
17
|
-
const appObjects = makeAppObjectRepo();
|
|
18
|
-
const ao = setupStandardFramedScreen(appObjects, {
|
|
19
|
-
dontSetupLayoutHook: false,
|
|
20
|
-
});
|
|
21
|
-
expect(ao.hasComponent("StandardLayoutUC")).toBe(true);
|
|
22
|
-
});
|
|
23
|
-
it("Adds the StandardLayoutUC if the option is not set", () => {
|
|
24
|
-
const appObjects = makeAppObjectRepo();
|
|
25
|
-
const ao = setupStandardFramedScreen(appObjects, {});
|
|
26
|
-
expect(ao.hasComponent("StandardLayoutUC")).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=setupStandardFramedScreen.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupStandardFramedScreen.test.js","sourceRoot":"","sources":["../../../../src/FramedScreen/Factories/setupStandardFramedScreen.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;QAEvC,MAAM,EAAE,GAAG,yBAAyB,CAAC,UAAU,CAAC,CAAC;QAEjD,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;QAEvC,MAAM,EAAE,GAAG,yBAAyB,CAAC,UAAU,EAAE;YAC/C,mBAAmB,EAAE,IAAI;SAC1B,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;QAEvC,MAAM,EAAE,GAAG,yBAAyB,CAAC,UAAU,EAAE;YAC/C,mBAAmB,EAAE,KAAK;SAC3B,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;QAEvC,MAAM,EAAE,GAAG,yBAAyB,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAErD,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { makeAppObjectRepo } from \"@vived/core\";\r\nimport { setupStandardFramedScreen } from \"./setupStandardFramedScreen\";\r\n\r\ndescribe(\"setupStandardFramedScreen\", () => {\r\n it(\"Defaults to adding the StandardLayoutUC\", () => {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const ao = setupStandardFramedScreen(appObjects);\r\n\r\n expect(ao.hasComponent(\"StandardLayoutUC\")).toBe(true);\r\n });\r\n\r\n it(\"Does not add the StandardLayoutUC if the option is set to true\", () => {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const ao = setupStandardFramedScreen(appObjects, {\r\n dontSetupLayoutHook: true,\r\n });\r\n\r\n expect(ao.hasComponent(\"StandardLayoutUC\")).toBe(false);\r\n });\r\n\r\n it(\"Adds the StandardLayoutUC if the option is set to false\", () => {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const ao = setupStandardFramedScreen(appObjects, {\r\n dontSetupLayoutHook: false,\r\n });\r\n\r\n expect(ao.hasComponent(\"StandardLayoutUC\")).toBe(true);\r\n });\r\n\r\n it(\"Adds the StandardLayoutUC if the option is not set\", () => {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n const ao = setupStandardFramedScreen(appObjects, {});\r\n\r\n expect(ao.hasComponent(\"StandardLayoutUC\")).toBe(true);\r\n });\r\n});\r\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { StateMachineEntity } from "../Entities";
|
|
2
|
-
export function clickRestoreScene(appObjects) {
|
|
3
|
-
const entity = StateMachineEntity.get(appObjects);
|
|
4
|
-
if (entity) {
|
|
5
|
-
entity.restoreLastState();
|
|
6
|
-
}
|
|
7
|
-
else {
|
|
8
|
-
appObjects.submitError("clickRestoreScene", "Unable to find StateMachineEntity");
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=clickRestoreScene.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clickRestoreScene.js","sourceRoot":"","sources":["../../../../src/StateMachine/Controller/clickRestoreScene.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,UAAU,iBAAiB,CAAC,UAAyB;IACzD,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAClD,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,WAAW,CACpB,mBAAmB,EACnB,mCAAmC,CACpC,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { AppObjectRepo } from \"@vived/core\";\nimport { StateMachineEntity } from \"../Entities\";\n\nexport function clickRestoreScene(appObjects: AppObjectRepo) {\n const entity = StateMachineEntity.get(appObjects);\n if (entity) {\n entity.restoreLastState();\n } else {\n appObjects.submitError(\n \"clickRestoreScene\",\n \"Unable to find StateMachineEntity\",\n );\n }\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { makeAppObjectRepo } from "@vived/core";
|
|
2
|
-
import { makeMockStateMachine } from "../Mocks";
|
|
3
|
-
import { clickRestoreScene } from "./clickRestoreScene";
|
|
4
|
-
function makeTestRig() {
|
|
5
|
-
const appObjects = makeAppObjectRepo();
|
|
6
|
-
const stateMachine = makeMockStateMachine(appObjects);
|
|
7
|
-
return { appObjects, stateMachine };
|
|
8
|
-
}
|
|
9
|
-
describe("Click Restore Scene", () => {
|
|
10
|
-
it("Calls restore on the entity", () => {
|
|
11
|
-
const { appObjects, stateMachine } = makeTestRig();
|
|
12
|
-
stateMachine.restoreLastState = jest.fn();
|
|
13
|
-
clickRestoreScene(appObjects);
|
|
14
|
-
expect(stateMachine.restoreLastState).toHaveBeenCalled();
|
|
15
|
-
});
|
|
16
|
-
it("Logs an error if the state machine cannot be found", () => {
|
|
17
|
-
const appObjects = makeAppObjectRepo();
|
|
18
|
-
appObjects.submitWarning = jest.fn();
|
|
19
|
-
appObjects.submitError = jest.fn();
|
|
20
|
-
clickRestoreScene(appObjects);
|
|
21
|
-
expect(appObjects.submitError).toHaveBeenCalled();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
//# sourceMappingURL=clickRestoreScene.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clickRestoreScene.test.js","sourceRoot":"","sources":["../../../../src/StateMachine/Controller/clickRestoreScene.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,SAAS,WAAW;IAClB,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;IACvC,MAAM,YAAY,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAEtD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AACtC,CAAC;AAED,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,WAAW,EAAE,CAAC;QAEnD,YAAY,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAC1C,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAE9B,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;QAEvC,UAAU,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QACrC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAEnC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAC9B,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { makeAppObjectRepo } from \"@vived/core\";\nimport { makeMockStateMachine } from \"../Mocks\";\nimport { clickRestoreScene } from \"./clickRestoreScene\";\n\nfunction makeTestRig() {\n const appObjects = makeAppObjectRepo();\n const stateMachine = makeMockStateMachine(appObjects);\n\n return { appObjects, stateMachine };\n}\n\ndescribe(\"Click Restore Scene\", () => {\n it(\"Calls restore on the entity\", () => {\n const { appObjects, stateMachine } = makeTestRig();\n\n stateMachine.restoreLastState = jest.fn();\n clickRestoreScene(appObjects);\n\n expect(stateMachine.restoreLastState).toHaveBeenCalled();\n });\n\n it(\"Logs an error if the state machine cannot be found\", () => {\n const appObjects = makeAppObjectRepo();\n\n appObjects.submitWarning = jest.fn();\n appObjects.submitError = jest.fn();\n\n clickRestoreScene(appObjects);\n expect(appObjects.submitError).toHaveBeenCalled();\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/TestUtils/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from \"./setupFeatureForTesting\";\r\n"]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* setupFeatureForTesting.ts
|
|
3
|
-
*
|
|
4
|
-
* The feature-context test harness for this Feature Library.
|
|
5
|
-
*
|
|
6
|
-
* This package has no app-level domain (no `makeDomain`, no single repo), so there is no
|
|
7
|
-
* global "make the domain" harness. The unit of test context is a **Feature** (or a small
|
|
8
|
-
* cluster of Features), wired the way a Slide App wires it — through each Feature's
|
|
9
|
-
* `FeatureFactory` (the current standard), using the same phased orchestration production
|
|
10
|
-
* uses. See `CLAUDE.md` and `docs/agents/domain.md`.
|
|
11
|
-
*
|
|
12
|
-
* Use this for **wiring / lifecycle** tests — proving that a Feature, once really wired,
|
|
13
|
-
* behaves end-to-end (e.g. a Challenge submits its result when the student leaves the slide).
|
|
14
|
-
* For pure **logic** tests of a single UC or PM, a hand-wired `makeAppObjectRepo()` rig with
|
|
15
|
-
* the collaborators mocked at the boundary is lighter and still preferred — see
|
|
16
|
-
* `src/ObjectPick/UseCases/TrySubmitObjectPickUC.test.ts` as the reference.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // LabelDrop's submit path depends on Challenge (for `selectedChallenge`) and the
|
|
20
|
-
* // Dispatcher (the Host boundary). List dependencies first, exactly as a Slide App would.
|
|
21
|
-
* const { appObjects } = setupFeatureForTesting([
|
|
22
|
-
* makeDispatcherFeatureFactory,
|
|
23
|
-
* makeChallengeFeatureFactory,
|
|
24
|
-
* makeLabelDropFeatureFactory,
|
|
25
|
-
* ]);
|
|
26
|
-
* // Then act through a Controller / navigation seam and assert through an Adapter VM or a
|
|
27
|
-
* // dispatcher mock registered before setup.
|
|
28
|
-
*/
|
|
29
|
-
import { makeAppObjectRepo, makeDomainFactoryRepo, } from "@vived/core";
|
|
30
|
-
/**
|
|
31
|
-
* Wire one or more Features into a fresh repo for a feature-context test.
|
|
32
|
-
*
|
|
33
|
-
* @param featureFactories The `make<Feature>FeatureFactory` functions to wire, in the order a
|
|
34
|
-
* Slide App would compose them — a Feature whose `finalSetup` depends on another Feature's
|
|
35
|
-
* entities must be listed *after* that Feature.
|
|
36
|
-
* @param seed Optional callback run *before* the factories are constructed. Use it to stand up
|
|
37
|
-
* the boundary singletons a Feature reads at construction time (many Feature UCs resolve
|
|
38
|
-
* siblings via `getCachedSingleton`, which THROWS when absent — e.g. `BaseAppState`,
|
|
39
|
-
* `ChallengeEntity`). Seed real entities or their Mocks here instead of pulling every
|
|
40
|
-
* dependency Feature's factory into the cluster.
|
|
41
|
-
* @returns `{ appObjects }` — resolve Controllers and Adapters from it to act and assert.
|
|
42
|
-
*/
|
|
43
|
-
export function setupFeatureForTesting(featureFactories, seed) {
|
|
44
|
-
const appObjects = makeAppObjectRepo();
|
|
45
|
-
// The DomainFactoryRepo must exist before the factories are constructed: each
|
|
46
|
-
// FeatureFactory auto-registers with it in its constructor.
|
|
47
|
-
const factoryRepo = makeDomainFactoryRepo(appObjects);
|
|
48
|
-
// Stand up boundary singletons the Features read at construction time.
|
|
49
|
-
if (seed)
|
|
50
|
-
seed(appObjects);
|
|
51
|
-
featureFactories.forEach((makeFactory) => makeFactory(appObjects));
|
|
52
|
-
// Run the same phased orchestration as production — all setupEntities, then all setupUCs,
|
|
53
|
-
// then all setupPMs, then all finalSetup — so cross-Feature dependencies resolve correctly.
|
|
54
|
-
factoryRepo.setupDomain();
|
|
55
|
-
return { appObjects };
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=setupFeatureForTesting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupFeatureForTesting.js","sourceRoot":"","sources":["../../../src/TestUtils/setupFeatureForTesting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAGL,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAOrB;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,sBAAsB,CACpC,gBAAkE,EAClE,IAA0C;IAE1C,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;IAEvC,8EAA8E;IAC9E,4DAA4D;IAC5D,MAAM,WAAW,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAEtD,uEAAuE;IACvE,IAAI,IAAI;QAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAE3B,gBAAgB,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC;IAEnE,0FAA0F;IAC1F,4FAA4F;IAC5F,WAAW,CAAC,WAAW,EAAE,CAAC;IAE1B,OAAO,EAAE,UAAU,EAAE,CAAC;AACxB,CAAC","sourcesContent":["/**\r\n * setupFeatureForTesting.ts\r\n *\r\n * The feature-context test harness for this Feature Library.\r\n *\r\n * This package has no app-level domain (no `makeDomain`, no single repo), so there is no\r\n * global \"make the domain\" harness. The unit of test context is a **Feature** (or a small\r\n * cluster of Features), wired the way a Slide App wires it — through each Feature's\r\n * `FeatureFactory` (the current standard), using the same phased orchestration production\r\n * uses. See `CLAUDE.md` and `docs/agents/domain.md`.\r\n *\r\n * Use this for **wiring / lifecycle** tests — proving that a Feature, once really wired,\r\n * behaves end-to-end (e.g. a Challenge submits its result when the student leaves the slide).\r\n * For pure **logic** tests of a single UC or PM, a hand-wired `makeAppObjectRepo()` rig with\r\n * the collaborators mocked at the boundary is lighter and still preferred — see\r\n * `src/ObjectPick/UseCases/TrySubmitObjectPickUC.test.ts` as the reference.\r\n *\r\n * @example\r\n * // LabelDrop's submit path depends on Challenge (for `selectedChallenge`) and the\r\n * // Dispatcher (the Host boundary). List dependencies first, exactly as a Slide App would.\r\n * const { appObjects } = setupFeatureForTesting([\r\n * makeDispatcherFeatureFactory,\r\n * makeChallengeFeatureFactory,\r\n * makeLabelDropFeatureFactory,\r\n * ]);\r\n * // Then act through a Controller / navigation seam and assert through an Adapter VM or a\r\n * // dispatcher mock registered before setup.\r\n */\r\n\r\nimport {\r\n AppObjectRepo,\r\n DomainFactory,\r\n makeAppObjectRepo,\r\n makeDomainFactoryRepo,\r\n} from \"@vived/core\";\r\n\r\nexport interface FeatureTestContext {\r\n /** The live repo, wired through the given FeatureFactories exactly as production does. */\r\n appObjects: AppObjectRepo;\r\n}\r\n\r\n/**\r\n * Wire one or more Features into a fresh repo for a feature-context test.\r\n *\r\n * @param featureFactories The `make<Feature>FeatureFactory` functions to wire, in the order a\r\n * Slide App would compose them — a Feature whose `finalSetup` depends on another Feature's\r\n * entities must be listed *after* that Feature.\r\n * @param seed Optional callback run *before* the factories are constructed. Use it to stand up\r\n * the boundary singletons a Feature reads at construction time (many Feature UCs resolve\r\n * siblings via `getCachedSingleton`, which THROWS when absent — e.g. `BaseAppState`,\r\n * `ChallengeEntity`). Seed real entities or their Mocks here instead of pulling every\r\n * dependency Feature's factory into the cluster.\r\n * @returns `{ appObjects }` — resolve Controllers and Adapters from it to act and assert.\r\n */\r\nexport function setupFeatureForTesting(\r\n featureFactories: ((appObjects: AppObjectRepo) => DomainFactory)[],\r\n seed?: (appObjects: AppObjectRepo) => void,\r\n): FeatureTestContext {\r\n const appObjects = makeAppObjectRepo();\r\n\r\n // The DomainFactoryRepo must exist before the factories are constructed: each\r\n // FeatureFactory auto-registers with it in its constructor.\r\n const factoryRepo = makeDomainFactoryRepo(appObjects);\r\n\r\n // Stand up boundary singletons the Features read at construction time.\r\n if (seed) seed(appObjects);\r\n\r\n featureFactories.forEach((makeFactory) => makeFactory(appObjects));\r\n\r\n // Run the same phased orchestration as production — all setupEntities, then all setupUCs,\r\n // then all setupPMs, then all finalSetup — so cross-Feature dependencies resolve correctly.\r\n factoryRepo.setupDomain();\r\n\r\n return { appObjects };\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupStandardFramedScreen.test.d.ts","sourceRoot":"","sources":["../../../../src/FramedScreen/Factories/setupStandardFramedScreen.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clickRestoreScene.d.ts","sourceRoot":"","sources":["../../../../src/StateMachine/Controller/clickRestoreScene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,aAAa,QAU1D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clickRestoreScene.test.d.ts","sourceRoot":"","sources":["../../../../src/StateMachine/Controller/clickRestoreScene.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/TestUtils/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* setupFeatureForTesting.ts
|
|
3
|
-
*
|
|
4
|
-
* The feature-context test harness for this Feature Library.
|
|
5
|
-
*
|
|
6
|
-
* This package has no app-level domain (no `makeDomain`, no single repo), so there is no
|
|
7
|
-
* global "make the domain" harness. The unit of test context is a **Feature** (or a small
|
|
8
|
-
* cluster of Features), wired the way a Slide App wires it — through each Feature's
|
|
9
|
-
* `FeatureFactory` (the current standard), using the same phased orchestration production
|
|
10
|
-
* uses. See `CLAUDE.md` and `docs/agents/domain.md`.
|
|
11
|
-
*
|
|
12
|
-
* Use this for **wiring / lifecycle** tests — proving that a Feature, once really wired,
|
|
13
|
-
* behaves end-to-end (e.g. a Challenge submits its result when the student leaves the slide).
|
|
14
|
-
* For pure **logic** tests of a single UC or PM, a hand-wired `makeAppObjectRepo()` rig with
|
|
15
|
-
* the collaborators mocked at the boundary is lighter and still preferred — see
|
|
16
|
-
* `src/ObjectPick/UseCases/TrySubmitObjectPickUC.test.ts` as the reference.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* // LabelDrop's submit path depends on Challenge (for `selectedChallenge`) and the
|
|
20
|
-
* // Dispatcher (the Host boundary). List dependencies first, exactly as a Slide App would.
|
|
21
|
-
* const { appObjects } = setupFeatureForTesting([
|
|
22
|
-
* makeDispatcherFeatureFactory,
|
|
23
|
-
* makeChallengeFeatureFactory,
|
|
24
|
-
* makeLabelDropFeatureFactory,
|
|
25
|
-
* ]);
|
|
26
|
-
* // Then act through a Controller / navigation seam and assert through an Adapter VM or a
|
|
27
|
-
* // dispatcher mock registered before setup.
|
|
28
|
-
*/
|
|
29
|
-
import { AppObjectRepo, DomainFactory } from "@vived/core";
|
|
30
|
-
export interface FeatureTestContext {
|
|
31
|
-
/** The live repo, wired through the given FeatureFactories exactly as production does. */
|
|
32
|
-
appObjects: AppObjectRepo;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Wire one or more Features into a fresh repo for a feature-context test.
|
|
36
|
-
*
|
|
37
|
-
* @param featureFactories The `make<Feature>FeatureFactory` functions to wire, in the order a
|
|
38
|
-
* Slide App would compose them — a Feature whose `finalSetup` depends on another Feature's
|
|
39
|
-
* entities must be listed *after* that Feature.
|
|
40
|
-
* @param seed Optional callback run *before* the factories are constructed. Use it to stand up
|
|
41
|
-
* the boundary singletons a Feature reads at construction time (many Feature UCs resolve
|
|
42
|
-
* siblings via `getCachedSingleton`, which THROWS when absent — e.g. `BaseAppState`,
|
|
43
|
-
* `ChallengeEntity`). Seed real entities or their Mocks here instead of pulling every
|
|
44
|
-
* dependency Feature's factory into the cluster.
|
|
45
|
-
* @returns `{ appObjects }` — resolve Controllers and Adapters from it to act and assert.
|
|
46
|
-
*/
|
|
47
|
-
export declare function setupFeatureForTesting(featureFactories: ((appObjects: AppObjectRepo) => DomainFactory)[], seed?: (appObjects: AppObjectRepo) => void): FeatureTestContext;
|
|
48
|
-
//# sourceMappingURL=setupFeatureForTesting.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setupFeatureForTesting.d.ts","sourceRoot":"","sources":["../../../src/TestUtils/setupFeatureForTesting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EAGd,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,kBAAkB;IACjC,0FAA0F;IAC1F,UAAU,EAAE,aAAa,CAAC;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,gBAAgB,EAAE,CAAC,CAAC,UAAU,EAAE,aAAa,KAAK,aAAa,CAAC,EAAE,EAClE,IAAI,CAAC,EAAE,CAAC,UAAU,EAAE,aAAa,KAAK,IAAI,GACzC,kBAAkB,CAiBpB"}
|