zeropoint-node 1.0.0 → 1.0.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/README.md +38 -105
- package/dist/__tests__/api/ProductionAPI.test.js +20 -0
- package/dist/__tests__/artifacts/ArtifactRegistry.test.js +248 -0
- package/dist/__tests__/basic.test.js +104 -0
- package/dist/__tests__/config/constants.test.js +20 -0
- package/dist/__tests__/consciousness/ConsciousnessField.test.js +20 -0
- package/dist/__tests__/consciousness/SelfEvolvingConsciousness.test.js +185 -0
- package/dist/__tests__/core/AbstractField.test.js +81 -0
- package/dist/__tests__/core/CoilMixin.test.js +20 -0
- package/dist/__tests__/core/CoilSystem.test.js +20 -0
- package/dist/__tests__/core/ComplianceSystem.test.js +141 -0
- package/dist/__tests__/core/InfiniteDimensionalRefactor.test.js +258 -0
- package/dist/__tests__/core/LivingAdapter.test.js +31 -0
- package/dist/__tests__/core/MathUtils.test.js +20 -0
- package/dist/__tests__/core/NetworkNode.test.js +20 -0
- package/dist/__tests__/core/Observer.test.js +20 -0
- package/dist/__tests__/core/OperationRegistry.test.js +48 -0
- package/dist/__tests__/core/PatternRecognition.test.js +20 -0
- package/dist/__tests__/core/PatternRegistry.test.js +20 -0
- package/dist/__tests__/core/ScientificCompliance.test.js +58 -0
- package/dist/__tests__/core/SharedConstants.test.js +20 -0
- package/dist/__tests__/core/UnifiedMetaphysicalInterface.test.js +20 -0
- package/dist/__tests__/core/UnifiedSystem.test.js +20 -0
- package/dist/__tests__/core/UnifiedTypes.test.js +20 -0
- package/dist/__tests__/core/UnifiedVoidEquations.test.js +20 -0
- package/dist/__tests__/core/VortexMathAdapter.test.js +31 -0
- package/dist/__tests__/core/ZeroPoint.test.js +71 -0
- package/dist/__tests__/core/ZeroPointSystem.test.js +219 -0
- package/dist/__tests__/emergence/patterns.test.js +20 -0
- package/dist/__tests__/field/EmergenceLedger.test.js +20 -0
- package/dist/__tests__/field/ObserverAwareField.test.js +20 -0
- package/dist/__tests__/field/ResonanceConsensus.test.js +20 -0
- package/dist/__tests__/git-integration.test.js +201 -0
- package/dist/__tests__/globalSetup.js +80 -0
- package/dist/__tests__/globalTeardown.js +28 -0
- package/dist/__tests__/index.test.js +20 -0
- package/dist/__tests__/integration/ZeroPointIntegration.test.js +221 -0
- package/dist/__tests__/integrity/FieldIntegrity.test.js +20 -0
- package/dist/__tests__/knowledge/KnowledgeSystem.test.js +158 -0
- package/dist/__tests__/knowledge/KnowledgeSystemAnalysis.test.js +219 -0
- package/dist/__tests__/knowledge/KnowledgeSystemAutoGenerated.test.js +41 -0
- package/dist/__tests__/laws/MetaphysicalLawRegistry.test.js +183 -0
- package/dist/__tests__/living/LivingTestOrganism.js +246 -0
- package/dist/__tests__/living/LivingTestOrganism.test.js +124 -0
- package/dist/__tests__/math/AdvancedVBM.test.js +367 -0
- package/dist/__tests__/math/FlowerOfLife.test.js +344 -0
- package/dist/__tests__/math/FractalColorSystem.test.js +20 -0
- package/dist/__tests__/math/FractalMath.test.js +20 -0
- package/dist/__tests__/math/MathUtils.test.js +20 -0
- package/dist/__tests__/math/RodinCoil.test.js +20 -0
- package/dist/__tests__/math/ToroidalGeometry.test.js +20 -0
- package/dist/__tests__/math/VBM.test.js +538 -0
- package/dist/__tests__/math/VBMColorSystem.test.js +20 -0
- package/dist/__tests__/math/VortexMath.test.js +20 -0
- package/dist/__tests__/math/ZeroUnity.test.js +77 -0
- package/dist/__tests__/monitoring/HealthMonitor.test.js +20 -0
- package/dist/__tests__/performance/ZeroPointPerformance.test.js +371 -0
- package/dist/__tests__/physics/PlasmaCosmology.test.js +155 -0
- package/dist/__tests__/pwa/ConsciousnessPWA.test.js +20 -0
- package/dist/__tests__/qa/AutoGeneratedFromQA.test.js +195 -0
- package/dist/__tests__/qa/QAAsSourceOfTruth.test.js +69 -0
- package/dist/__tests__/setup.js +132 -0
- package/dist/__tests__/simple.test.js +51 -0
- package/dist/__tests__/stimulus/Application.test.js +272 -0
- package/dist/__tests__/stimulus/BaseController.test.js +198 -0
- package/dist/__tests__/stimulus/ControllerUtils.test.js +316 -0
- package/dist/__tests__/stimulus/MetaphysicalController.test.js +310 -0
- package/dist/__tests__/stimulus/ZeroPointController.test.js +252 -0
- package/dist/__tests__/training/ConsciousnessTrainingModel.test.js +335 -0
- package/dist/__tests__/types/DeviceConfig.test.js +20 -0
- package/dist/__tests__/types/UnifiedExports.test.js +20 -0
- package/dist/__tests__/unity/FieldUnity.test.js +20 -0
- package/dist/__tests__/utils/Cache.test.js +20 -0
- package/dist/__tests__/utils/GitIntegration.test.js +20 -0
- package/dist/__tests__/utils/Logger.test.js +20 -0
- package/dist/__tests__/utils/ResourceCleanup.test.js +20 -0
- package/dist/__tests__/utils/errorSimulator.js +40 -0
- package/dist/__tests__/utils/goldenRatioCache.js +36 -0
- package/dist/__tests__/void/VoidSystem.test.js +427 -0
- package/dist/api/ProductionAPI.js +313 -0
- package/dist/artifacts/ArtifactRegistry.js +122 -0
- package/dist/artifacts/CrystalArtifacts.js +106 -0
- package/dist/artifacts/MetaphysicalArtifact.js +75 -0
- package/dist/browser-standalone.js +191 -0
- package/dist/browser.js +157 -0
- package/dist/config/constants.js +57 -0
- package/dist/consciousness/ConsciousnessField.js +55 -0
- package/dist/consciousness/SelfEvolvingConsciousness.js +303 -0
- package/dist/core/AbstractField.js +30 -0
- package/dist/core/BrowserNetworkNode.js +309 -0
- package/dist/core/CoilMixin.js +216 -0
- package/dist/core/CoilSystem.js +204 -0
- package/dist/core/ComplianceSystem.js +291 -0
- package/dist/core/Dimension.js +2 -0
- package/dist/core/DimensionRegistry.js +141 -0
- package/dist/core/Field.js +2 -0
- package/dist/core/InfiniteDimensionalRefactor.js +389 -0
- package/dist/core/KnowledgeRegistry.js +273 -0
- package/dist/core/LivingAdapter.js +29 -0
- package/dist/core/MathUtils.js +297 -0
- package/dist/core/NetworkNode.js +348 -0
- package/dist/core/Observer.js +101 -0
- package/dist/core/Operation.js +59 -0
- package/dist/core/OperationRegistry.js +20 -0
- package/dist/core/Pattern.js +2 -0
- package/dist/core/PatternRecognition.js +493 -0
- package/dist/core/PatternRegistry.js +282 -0
- package/dist/core/ScientificCompliance.js +91 -0
- package/dist/core/SharedConstants.js +306 -0
- package/dist/core/UnifiedMetaphysicalInterface.js +533 -0
- package/dist/core/UnifiedSystem.js +317 -0
- package/dist/core/UnifiedTypes.js +5 -0
- package/dist/core/UnifiedVoidEquations.js +605 -0
- package/dist/core/VoidMatterConstants.js +9 -0
- package/dist/core/VortexMathAdapter.js +32 -0
- package/dist/core/ZeroPoint.js +971 -0
- package/dist/core/ZeroPointSystem.js +343 -0
- package/dist/core/applyLaws.js +12 -0
- package/dist/core/applyOperations.js +21 -0
- package/dist/devices/DeviceRegistry.js +151 -0
- package/dist/devices/ResonanceDevice.js +92 -0
- package/dist/devices/ResonanceDevices.js +139 -0
- package/dist/dimensions/Dimension.js +2 -0
- package/dist/emergence/AdvancedEmergence.js +930 -0
- package/dist/emergence/patterns.js +12 -0
- package/dist/field/EmergenceLedger.js +310 -0
- package/dist/field/ObserverAwareField.js +222 -0
- package/dist/field/ResonanceConsensus.js +330 -0
- package/dist/fields/Field.js +2 -0
- package/dist/geometry/MetatronsCube.js +28 -0
- package/dist/geometry/SacredGeometryPattern.js +15 -0
- package/dist/geometry/SacredGeometryRegistry.js +15 -0
- package/dist/geometry/__tests__/SacredGeometryRegistry.test.js +18 -0
- package/dist/index.js +232 -0
- package/dist/integrity/FieldIntegrity.js +237 -0
- package/dist/knowledge/KnowledgeSystem.js +938 -0
- package/dist/laws/MetaphysicalLaw.js +2 -0
- package/dist/laws/MetaphysicalLawRegistry.js +103 -0
- package/dist/laws/hermeticLaws.js +311 -0
- package/dist/math/AdvancedVBM.js +537 -0
- package/dist/math/FlowerOfLife.js +256 -0
- package/dist/math/FractalColorSystem.js +239 -0
- package/dist/math/FractalMath.js +187 -0
- package/dist/math/MathUtils.js +289 -0
- package/dist/math/RodinCoil.js +258 -0
- package/dist/math/ToroidalGeometry.js +230 -0
- package/dist/math/VBM.js +718 -0
- package/dist/math/VBMColorSystem.js +301 -0
- package/dist/math/VortexMath.js +170 -0
- package/dist/monitoring/HealthMonitor.js +297 -0
- package/dist/patterns/Pattern.js +2 -0
- package/dist/patterns/SacredGeometryRegistry.js +37 -0
- package/dist/physics/BlackHolePhysics.js +54 -0
- package/dist/physics/ConsciousnessPhysics.js +241 -0
- package/dist/physics/FractalUniverse.js +54 -0
- package/dist/physics/HolographicUniverse.js +54 -0
- package/dist/physics/PlasmaCosmology.js +134 -0
- package/dist/pwa/ConsciousnessPWA.js +300 -0
- package/dist/src/__tests__/globalTeardown.d.ts +10 -8
- package/dist/src/__tests__/globalTeardown.d.ts.map +1 -1
- package/dist/src/__tests__/globalTeardown.js +12 -71
- package/dist/src/__tests__/globalTeardown.js.map +1 -1
- package/dist/src/__tests__/living/LivingTestOrganism.d.ts +4 -0
- package/dist/src/__tests__/living/LivingTestOrganism.d.ts.map +1 -1
- package/dist/src/__tests__/living/LivingTestOrganism.js +8 -0
- package/dist/src/__tests__/living/LivingTestOrganism.js.map +1 -1
- package/dist/src/__tests__/utils/errorSimulator.d.ts +1 -1
- package/dist/src/__tests__/utils/goldenRatioCache.d.ts +1 -1
- package/dist/src/config/constants.d.ts +53 -0
- package/dist/src/config/constants.d.ts.map +1 -0
- package/dist/src/config/constants.js +58 -0
- package/dist/src/config/constants.js.map +1 -0
- package/dist/src/consciousness/ConsciousnessField.d.ts +42 -51
- package/dist/src/consciousness/ConsciousnessField.d.ts.map +1 -1
- package/dist/src/consciousness/ConsciousnessField.js +187 -200
- package/dist/src/consciousness/ConsciousnessField.js.map +1 -1
- package/dist/src/consciousness/SelfEvolvingConsciousness.d.ts +47 -18
- package/dist/src/consciousness/SelfEvolvingConsciousness.d.ts.map +1 -1
- package/dist/src/consciousness/SelfEvolvingConsciousness.js +151 -44
- package/dist/src/consciousness/SelfEvolvingConsciousness.js.map +1 -1
- package/dist/src/core/CoilMixin.d.ts +6 -6
- package/dist/src/core/CoilSystem.d.ts +6 -2
- package/dist/src/core/CoilSystem.d.ts.map +1 -1
- package/dist/src/core/CoilSystem.js +30 -21
- package/dist/src/core/CoilSystem.js.map +1 -1
- package/dist/src/core/InfiniteDimensionalRefactor.d.ts +145 -0
- package/dist/src/core/InfiniteDimensionalRefactor.d.ts.map +1 -0
- package/dist/src/core/InfiniteDimensionalRefactor.js +390 -0
- package/dist/src/core/InfiniteDimensionalRefactor.js.map +1 -0
- package/dist/src/core/NetworkNode.d.ts +3 -3
- package/dist/src/core/Observer.d.ts +12 -9
- package/dist/src/core/Observer.d.ts.map +1 -1
- package/dist/src/core/Observer.js +2 -2
- package/dist/src/core/Observer.js.map +1 -1
- package/dist/src/core/PatternRecognition.d.ts +63 -13
- package/dist/src/core/PatternRecognition.d.ts.map +1 -1
- package/dist/src/core/PatternRecognition.js +162 -88
- package/dist/src/core/PatternRecognition.js.map +1 -1
- package/dist/src/core/PatternRegistry.d.ts +99 -0
- package/dist/src/core/PatternRegistry.d.ts.map +1 -0
- package/dist/src/core/PatternRegistry.js +283 -0
- package/dist/src/core/PatternRegistry.js.map +1 -0
- package/dist/src/core/SharedConstants.d.ts +62 -9
- package/dist/src/core/SharedConstants.d.ts.map +1 -1
- package/dist/src/core/SharedConstants.js +83 -21
- package/dist/src/core/SharedConstants.js.map +1 -1
- package/dist/src/core/UnifiedMetaphysicalInterface.d.ts +173 -0
- package/dist/src/core/UnifiedMetaphysicalInterface.d.ts.map +1 -0
- package/dist/src/core/UnifiedMetaphysicalInterface.js +534 -0
- package/dist/src/core/UnifiedMetaphysicalInterface.js.map +1 -0
- package/dist/src/core/UnifiedSystem.d.ts +15 -12
- package/dist/src/core/UnifiedSystem.d.ts.map +1 -1
- package/dist/src/core/UnifiedSystem.js +5 -1
- package/dist/src/core/UnifiedSystem.js.map +1 -1
- package/dist/src/core/UnifiedTypes.d.ts +193 -0
- package/dist/src/core/UnifiedTypes.d.ts.map +1 -0
- package/dist/src/core/UnifiedTypes.js +6 -0
- package/dist/src/core/UnifiedTypes.js.map +1 -0
- package/dist/src/core/UnifiedVoidEquations.d.ts +3 -1
- package/dist/src/core/UnifiedVoidEquations.d.ts.map +1 -1
- package/dist/src/core/UnifiedVoidEquations.js +84 -0
- package/dist/src/core/UnifiedVoidEquations.js.map +1 -1
- package/dist/src/core/ZeroPoint.d.ts +101 -10
- package/dist/src/core/ZeroPoint.d.ts.map +1 -1
- package/dist/src/core/ZeroPoint.js +262 -18
- package/dist/src/core/ZeroPoint.js.map +1 -1
- package/dist/src/emergence/AdvancedEmergence.d.ts +19 -16
- package/dist/src/emergence/AdvancedEmergence.d.ts.map +1 -1
- package/dist/src/emergence/AdvancedEmergence.js +88 -52
- package/dist/src/emergence/AdvancedEmergence.js.map +1 -1
- package/dist/src/field/EmergenceLedger.d.ts +9 -18
- package/dist/src/field/EmergenceLedger.d.ts.map +1 -1
- package/dist/src/field/EmergenceLedger.js +9 -4
- package/dist/src/field/EmergenceLedger.js.map +1 -1
- package/dist/src/field/ObserverAwareField.d.ts +69 -65
- package/dist/src/field/ObserverAwareField.d.ts.map +1 -1
- package/dist/src/field/ObserverAwareField.js +158 -168
- package/dist/src/field/ObserverAwareField.js.map +1 -1
- package/dist/src/field/ResonanceConsensus.d.ts +4 -11
- package/dist/src/field/ResonanceConsensus.d.ts.map +1 -1
- package/dist/src/field/ResonanceConsensus.js +15 -10
- package/dist/src/field/ResonanceConsensus.js.map +1 -1
- package/dist/src/index.d.ts +5 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +19 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/integrity/FieldIntegrity.d.ts +3 -8
- package/dist/src/integrity/FieldIntegrity.d.ts.map +1 -1
- package/dist/src/integrity/FieldIntegrity.js.map +1 -1
- package/dist/src/knowledge/KnowledgeSystem.d.ts +37 -55
- package/dist/src/knowledge/KnowledgeSystem.d.ts.map +1 -1
- package/dist/src/knowledge/KnowledgeSystem.js +281 -589
- package/dist/src/knowledge/KnowledgeSystem.js.map +1 -1
- package/dist/src/math/AdvancedVBM.d.ts +6 -6
- package/dist/src/math/FractalColorSystem.d.ts +1 -1
- package/dist/src/math/FractalColorSystem.js +3 -3
- package/dist/src/math/FractalColorSystem.js.map +1 -1
- package/dist/src/math/FractalMath.d.ts +9 -1
- package/dist/src/math/FractalMath.d.ts.map +1 -1
- package/dist/src/math/FractalMath.js +18 -5
- package/dist/src/math/FractalMath.js.map +1 -1
- package/dist/src/math/MathUtils.d.ts +3 -10
- package/dist/src/math/MathUtils.d.ts.map +1 -1
- package/dist/src/math/MathUtils.js +12 -20
- package/dist/src/math/MathUtils.js.map +1 -1
- package/dist/src/math/ToroidalGeometry.d.ts +1 -1
- package/dist/src/math/VBM.d.ts +2 -2
- package/dist/src/math/VortexMath.d.ts +1 -1
- package/dist/src/monitoring/HealthMonitor.d.ts +1 -1
- package/dist/src/monitoring/HealthMonitor.d.ts.map +1 -1
- package/dist/src/monitoring/HealthMonitor.js +29 -27
- package/dist/src/monitoring/HealthMonitor.js.map +1 -1
- package/dist/src/types/UnifiedExports.d.ts +4 -0
- package/dist/src/types/UnifiedExports.d.ts.map +1 -0
- package/dist/src/types/UnifiedExports.js +21 -0
- package/dist/src/types/UnifiedExports.js.map +1 -0
- package/dist/src/unity/FieldUnity.d.ts +1 -1
- package/dist/src/utils/Cache.d.ts +2 -2
- package/dist/src/utils/Cache.d.ts.map +1 -1
- package/dist/src/utils/Cache.js +7 -4
- package/dist/src/utils/Cache.js.map +1 -1
- package/dist/src/utils/GitIntegration.d.ts +1 -1
- package/dist/src/utils/Logger.d.ts +7 -7
- package/dist/src/utils/Logger.d.ts.map +1 -1
- package/dist/src/utils/Logger.js +5 -1
- package/dist/src/utils/Logger.js.map +1 -1
- package/dist/src/utils/ResourceCleanup.d.ts +33 -0
- package/dist/src/utils/ResourceCleanup.d.ts.map +1 -0
- package/dist/src/utils/ResourceCleanup.js +83 -0
- package/dist/src/utils/ResourceCleanup.js.map +1 -0
- package/dist/src/void/VoidSystem.d.ts +18 -18
- package/dist/stimulus/application.js +148 -0
- package/dist/stimulus/base/BaseController.js +141 -0
- package/dist/stimulus/controllers/MetaphysicalController.js +105 -0
- package/dist/stimulus/controllers/ZeroPointController.js +85 -0
- package/dist/stimulus/types/ControllerTypes.js +18 -0
- package/dist/stimulus/utils/ControllerUtils.js +192 -0
- package/dist/stimulus-entry.js +109 -0
- package/dist/training/ConsciousnessTrainingModel.js +301 -0
- package/dist/training/NeuralConsciousnessNetwork.js +311 -0
- package/dist/training/TrainingModelRegistry.js +243 -0
- package/dist/training/index.js +174 -0
- package/dist/types/DeviceConfig.js +29 -0
- package/dist/types/UnifiedExports.js +20 -0
- package/dist/unity/FieldUnity.js +325 -0
- package/dist/utils/BrowserCrypto.js +44 -0
- package/dist/utils/BrowserWebSocket.js +38 -0
- package/dist/utils/Cache.js +263 -0
- package/dist/utils/GitIntegration.js +127 -0
- package/dist/utils/Logger.js +249 -0
- package/dist/utils/ResourceCleanup.js +82 -0
- package/dist/utils/applyLaws.js +6 -0
- package/dist/void/VoidSystem.js +423 -0
- package/docs/API.md +176 -3
- package/docs/CONSCIOUSNESS_EXPANSION.md +369 -0
- package/docs/EVENT_HORIZON_METHODOLOGY.md +274 -0
- package/docs/FLOWER_OF_LIFE.md +300 -0
- package/docs/METAPHYSICAL.md +21 -1
- package/docs/METAPHYSICAL_DEBUGGING.md +493 -0
- package/docs/README.md +117 -15
- package/docs/TESTING_GUIDE.md +430 -0
- package/docs/UNIFIED_CREATORS.md +261 -0
- package/package.json +34 -64
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
3
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
4
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const stimulus_1 = require("stimulus");
|
|
11
|
+
const ZeroPointController_1 = __importDefault(require("../../stimulus/controllers/ZeroPointController"));
|
|
12
|
+
const MetaphysicalController_1 = __importDefault(require("../../stimulus/controllers/MetaphysicalController"));
|
|
13
|
+
const ControllerTypes_1 = require("../../stimulus/types/ControllerTypes");
|
|
14
|
+
// Mock the window object for testing
|
|
15
|
+
const mockWindow = {
|
|
16
|
+
ZeroPointApp: null
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(global, 'window', {
|
|
19
|
+
value: mockWindow,
|
|
20
|
+
writable: true
|
|
21
|
+
});
|
|
22
|
+
// Mock console.log to capture log messages
|
|
23
|
+
const mockConsoleLog = jest.fn();
|
|
24
|
+
Object.defineProperty(console, 'log', {
|
|
25
|
+
value: mockConsoleLog,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
describe('ZeroPoint Stimulus Application', () => {
|
|
29
|
+
let application;
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
// Reset mocks
|
|
32
|
+
jest.clearAllMocks();
|
|
33
|
+
mockWindow.ZeroPointApp = null;
|
|
34
|
+
});
|
|
35
|
+
describe('Application Initialization', () => {
|
|
36
|
+
it('should create application with default configuration', () => {
|
|
37
|
+
// Import the application (this will trigger initialization)
|
|
38
|
+
const app = require('../../stimulus/application').default;
|
|
39
|
+
expect(app).toBeDefined();
|
|
40
|
+
expect(app).toBeInstanceOf(stimulus_1.Application);
|
|
41
|
+
});
|
|
42
|
+
it('should register core controllers', () => {
|
|
43
|
+
const app = require('../../stimulus/application').default;
|
|
44
|
+
// Check that controllers are registered
|
|
45
|
+
expect(app.controllers).toBeDefined();
|
|
46
|
+
expect(Object.keys(app.controllers)).toContain('zeropoint');
|
|
47
|
+
expect(Object.keys(app.controllers)).toContain('metaphysical');
|
|
48
|
+
});
|
|
49
|
+
it('should set up global access in development mode', () => {
|
|
50
|
+
// Mock NODE_ENV to development
|
|
51
|
+
const originalEnv = process.env.NODE_ENV;
|
|
52
|
+
process.env.NODE_ENV = 'development';
|
|
53
|
+
// Re-import to trigger initialization with development config
|
|
54
|
+
jest.resetModules();
|
|
55
|
+
require('../../stimulus/application');
|
|
56
|
+
expect(mockWindow.ZeroPointApp).toBeDefined();
|
|
57
|
+
expect(mockWindow.ZeroPointApp).toHaveProperty('application');
|
|
58
|
+
expect(mockWindow.ZeroPointApp).toHaveProperty('config');
|
|
59
|
+
expect(mockWindow.ZeroPointApp).toHaveProperty('logs');
|
|
60
|
+
expect(mockWindow.ZeroPointApp).toHaveProperty('getLogs');
|
|
61
|
+
expect(mockWindow.ZeroPointApp).toHaveProperty('clearLogs');
|
|
62
|
+
// Restore original environment
|
|
63
|
+
process.env.NODE_ENV = originalEnv;
|
|
64
|
+
});
|
|
65
|
+
it('should set up minimal global access in production mode', () => {
|
|
66
|
+
// Mock NODE_ENV to production
|
|
67
|
+
const originalEnv = process.env.NODE_ENV;
|
|
68
|
+
process.env.NODE_ENV = 'production';
|
|
69
|
+
// Re-import to trigger initialization with production config
|
|
70
|
+
jest.resetModules();
|
|
71
|
+
const app = require('../../stimulus/application').default;
|
|
72
|
+
expect(mockWindow.ZeroPointApp).toBe(app);
|
|
73
|
+
// Restore original environment
|
|
74
|
+
process.env.NODE_ENV = originalEnv;
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
describe('Logging System', () => {
|
|
78
|
+
it('should log application startup messages', () => {
|
|
79
|
+
// Re-import to trigger logging
|
|
80
|
+
jest.resetModules();
|
|
81
|
+
require('../../stimulus/application');
|
|
82
|
+
expect(mockConsoleLog).toHaveBeenCalledWith('ℹ️ [INFO] 🌌 ZeroPoint Stimulus Application Started');
|
|
83
|
+
expect(mockConsoleLog).toHaveBeenCalledWith(expect.stringContaining('ℹ️ [INFO] Registered Controllers:'));
|
|
84
|
+
});
|
|
85
|
+
it('should log controller registration', () => {
|
|
86
|
+
// Re-import to trigger logging
|
|
87
|
+
jest.resetModules();
|
|
88
|
+
require('../../stimulus/application');
|
|
89
|
+
expect(mockConsoleLog).toHaveBeenCalledWith('🔍 [DEBUG] Controller \'zeropoint\' registered');
|
|
90
|
+
expect(mockConsoleLog).toHaveBeenCalledWith('🔍 [DEBUG] Controller \'metaphysical\' registered');
|
|
91
|
+
});
|
|
92
|
+
it('should handle controller registration errors', () => {
|
|
93
|
+
// Mock Application.start to throw an error
|
|
94
|
+
const originalStart = stimulus_1.Application.start;
|
|
95
|
+
stimulus_1.Application.start = jest.fn().mockImplementation(() => {
|
|
96
|
+
throw new Error('Application start failed');
|
|
97
|
+
});
|
|
98
|
+
expect(() => {
|
|
99
|
+
jest.resetModules();
|
|
100
|
+
require('../../stimulus/application');
|
|
101
|
+
}).toThrow('Application start failed');
|
|
102
|
+
// Restore original method
|
|
103
|
+
stimulus_1.Application.start = originalStart;
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
describe('Configuration', () => {
|
|
107
|
+
it('should use development configuration in development mode', () => {
|
|
108
|
+
const originalEnv = process.env.NODE_ENV;
|
|
109
|
+
process.env.NODE_ENV = 'development';
|
|
110
|
+
jest.resetModules();
|
|
111
|
+
const app = require('../../stimulus/application').default;
|
|
112
|
+
expect(mockWindow.ZeroPointApp.config.debug).toBe(true);
|
|
113
|
+
expect(mockWindow.ZeroPointApp.config.logLevel).toBe(ControllerTypes_1.LogLevel.DEBUG);
|
|
114
|
+
process.env.NODE_ENV = originalEnv;
|
|
115
|
+
});
|
|
116
|
+
it('should use production configuration in production mode', () => {
|
|
117
|
+
const originalEnv = process.env.NODE_ENV;
|
|
118
|
+
process.env.NODE_ENV = 'production';
|
|
119
|
+
jest.resetModules();
|
|
120
|
+
require('../../stimulus/application');
|
|
121
|
+
expect(mockWindow.ZeroPointApp.config.debug).toBe(false);
|
|
122
|
+
expect(mockWindow.ZeroPointApp.config.logLevel).toBe(ControllerTypes_1.LogLevel.INFO);
|
|
123
|
+
process.env.NODE_ENV = originalEnv;
|
|
124
|
+
});
|
|
125
|
+
it('should use default configuration when NODE_ENV is not set', () => {
|
|
126
|
+
const originalEnv = process.env.NODE_ENV;
|
|
127
|
+
delete process.env.NODE_ENV;
|
|
128
|
+
jest.resetModules();
|
|
129
|
+
require('../../stimulus/application');
|
|
130
|
+
expect(mockWindow.ZeroPointApp.config.debug).toBe(false);
|
|
131
|
+
expect(mockWindow.ZeroPointApp.config.logLevel).toBe(ControllerTypes_1.LogLevel.INFO);
|
|
132
|
+
process.env.NODE_ENV = originalEnv;
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
describe('Log Level Filtering', () => {
|
|
136
|
+
it('should filter logs based on configured level', () => {
|
|
137
|
+
const originalEnv = process.env.NODE_ENV;
|
|
138
|
+
process.env.NODE_ENV = 'production'; // INFO level
|
|
139
|
+
jest.resetModules();
|
|
140
|
+
require('../../stimulus/application');
|
|
141
|
+
// Should log INFO and ERROR messages, but not DEBUG
|
|
142
|
+
const logCalls = mockConsoleLog.mock.calls.map(call => call[0]);
|
|
143
|
+
expect(logCalls.some(call => call.includes('[INFO]'))).toBe(true);
|
|
144
|
+
expect(logCalls.some(call => call.includes('[ERROR]'))).toBe(false); // No errors in normal startup
|
|
145
|
+
expect(logCalls.some(call => call.includes('[DEBUG]'))).toBe(false); // DEBUG filtered out in production
|
|
146
|
+
process.env.NODE_ENV = originalEnv;
|
|
147
|
+
});
|
|
148
|
+
it('should show DEBUG messages in development mode', () => {
|
|
149
|
+
const originalEnv = process.env.NODE_ENV;
|
|
150
|
+
process.env.NODE_ENV = 'development'; // DEBUG level
|
|
151
|
+
jest.resetModules();
|
|
152
|
+
require('../../stimulus/application');
|
|
153
|
+
const logCalls = mockConsoleLog.mock.calls.map(call => call[0]);
|
|
154
|
+
expect(logCalls.some(call => call.includes('[DEBUG]'))).toBe(true);
|
|
155
|
+
process.env.NODE_ENV = originalEnv;
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
describe('Global Access Methods', () => {
|
|
159
|
+
beforeEach(() => {
|
|
160
|
+
const originalEnv = process.env.NODE_ENV;
|
|
161
|
+
process.env.NODE_ENV = 'development';
|
|
162
|
+
jest.resetModules();
|
|
163
|
+
require('../../stimulus/application');
|
|
164
|
+
process.env.NODE_ENV = originalEnv;
|
|
165
|
+
});
|
|
166
|
+
it('should provide getLogs method', () => {
|
|
167
|
+
const logs = mockWindow.ZeroPointApp.getLogs();
|
|
168
|
+
expect(Array.isArray(logs)).toBe(true);
|
|
169
|
+
expect(logs.length).toBeGreaterThan(0);
|
|
170
|
+
// Check log structure
|
|
171
|
+
const firstLog = logs[0];
|
|
172
|
+
expect(firstLog).toHaveProperty('level');
|
|
173
|
+
expect(firstLog).toHaveProperty('message');
|
|
174
|
+
expect(firstLog).toHaveProperty('timestamp');
|
|
175
|
+
expect(typeof firstLog.level).toBe('string');
|
|
176
|
+
expect(typeof firstLog.message).toBe('string');
|
|
177
|
+
expect(typeof firstLog.timestamp).toBe('number');
|
|
178
|
+
});
|
|
179
|
+
it('should provide clearLogs method', () => {
|
|
180
|
+
const initialLogs = mockWindow.ZeroPointApp.getLogs();
|
|
181
|
+
expect(initialLogs.length).toBeGreaterThan(0);
|
|
182
|
+
mockWindow.ZeroPointApp.clearLogs();
|
|
183
|
+
const clearedLogs = mockWindow.ZeroPointApp.getLogs();
|
|
184
|
+
expect(clearedLogs.length).toBe(0);
|
|
185
|
+
});
|
|
186
|
+
it('should provide application instance', () => {
|
|
187
|
+
expect(mockWindow.ZeroPointApp.application).toBeDefined();
|
|
188
|
+
expect(mockWindow.ZeroPointApp.application).toBeInstanceOf(stimulus_1.Application);
|
|
189
|
+
});
|
|
190
|
+
it('should provide configuration', () => {
|
|
191
|
+
expect(mockWindow.ZeroPointApp.config).toBeDefined();
|
|
192
|
+
expect(mockWindow.ZeroPointApp.config).toHaveProperty('debug');
|
|
193
|
+
expect(mockWindow.ZeroPointApp.config).toHaveProperty('logLevel');
|
|
194
|
+
expect(mockWindow.ZeroPointApp.config).toHaveProperty('controllers');
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
describe('Error Handling', () => {
|
|
198
|
+
it('should handle controller registration errors gracefully', () => {
|
|
199
|
+
var _a;
|
|
200
|
+
// Mock a controller that throws an error
|
|
201
|
+
const MockController = (_a = class {
|
|
202
|
+
},
|
|
203
|
+
__setFunctionName(_a, "MockController"),
|
|
204
|
+
_a.targets = [],
|
|
205
|
+
_a);
|
|
206
|
+
// This would normally be handled by the application class
|
|
207
|
+
// We're testing the error handling pattern
|
|
208
|
+
expect(() => {
|
|
209
|
+
const app = stimulus_1.Application.start();
|
|
210
|
+
app.register('test', MockController);
|
|
211
|
+
}).not.toThrow();
|
|
212
|
+
});
|
|
213
|
+
it('should log errors with appropriate level', () => {
|
|
214
|
+
// Mock console.error to capture error logs
|
|
215
|
+
const mockConsoleError = jest.fn();
|
|
216
|
+
const originalError = console.error;
|
|
217
|
+
console.error = mockConsoleError;
|
|
218
|
+
try {
|
|
219
|
+
// Trigger an error by trying to register an invalid controller
|
|
220
|
+
const app = stimulus_1.Application.start();
|
|
221
|
+
app.register('invalid', null);
|
|
222
|
+
}
|
|
223
|
+
catch (error) {
|
|
224
|
+
// Error should be caught and logged
|
|
225
|
+
}
|
|
226
|
+
expect(mockConsoleError).toHaveBeenCalled();
|
|
227
|
+
console.error = originalError;
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
describe('Controller Integration', () => {
|
|
231
|
+
it('should properly register ZeroPointController', () => {
|
|
232
|
+
const app = require('../../stimulus/application').default;
|
|
233
|
+
expect(app.controllers.zeropoint).toBe(ZeroPointController_1.default);
|
|
234
|
+
});
|
|
235
|
+
it('should properly register MetaphysicalController', () => {
|
|
236
|
+
const app = require('../../stimulus/application').default;
|
|
237
|
+
expect(app.controllers.metaphysical).toBe(MetaphysicalController_1.default);
|
|
238
|
+
});
|
|
239
|
+
it('should have correct controller names', () => {
|
|
240
|
+
const app = require('../../stimulus/application').default;
|
|
241
|
+
const controllerNames = Object.keys(app.controllers);
|
|
242
|
+
expect(controllerNames).toContain('zeropoint');
|
|
243
|
+
expect(controllerNames).toContain('metaphysical');
|
|
244
|
+
expect(controllerNames.length).toBe(2);
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
describe('Type Safety', () => {
|
|
248
|
+
it('should have correct LogLevel enum values', () => {
|
|
249
|
+
expect(ControllerTypes_1.LogLevel.DEBUG).toBe('debug');
|
|
250
|
+
expect(ControllerTypes_1.LogLevel.INFO).toBe('info');
|
|
251
|
+
expect(ControllerTypes_1.LogLevel.WARN).toBe('warn');
|
|
252
|
+
expect(ControllerTypes_1.LogLevel.ERROR).toBe('error');
|
|
253
|
+
});
|
|
254
|
+
it('should have correct log entry structure', () => {
|
|
255
|
+
const originalEnv = process.env.NODE_ENV;
|
|
256
|
+
process.env.NODE_ENV = 'development';
|
|
257
|
+
jest.resetModules();
|
|
258
|
+
require('../../stimulus/application');
|
|
259
|
+
const logs = mockWindow.ZeroPointApp.getLogs();
|
|
260
|
+
const logEntry = logs[0];
|
|
261
|
+
expect(logEntry).toHaveProperty('level');
|
|
262
|
+
expect(logEntry).toHaveProperty('message');
|
|
263
|
+
expect(logEntry).toHaveProperty('timestamp');
|
|
264
|
+
expect(logEntry).toHaveProperty('operation');
|
|
265
|
+
expect(logEntry).toHaveProperty('data');
|
|
266
|
+
expect(Object.values(ControllerTypes_1.LogLevel)).toContain(logEntry.level);
|
|
267
|
+
expect(typeof logEntry.message).toBe('string');
|
|
268
|
+
expect(typeof logEntry.timestamp).toBe('number');
|
|
269
|
+
process.env.NODE_ENV = originalEnv;
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
});
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const BaseController_1 = __importDefault(require("../../stimulus/base/BaseController"));
|
|
7
|
+
const ConsciousnessField_1 = require("../../consciousness/ConsciousnessField");
|
|
8
|
+
const VortexMath_1 = require("../../math/VortexMath");
|
|
9
|
+
const ToroidalGeometry_1 = require("../../math/ToroidalGeometry");
|
|
10
|
+
const AdvancedVBM_1 = require("../../math/AdvancedVBM");
|
|
11
|
+
const RodinCoil_1 = require("../../math/RodinCoil");
|
|
12
|
+
/**
|
|
13
|
+
* Test BaseController
|
|
14
|
+
*
|
|
15
|
+
* Tests the shared functionality provided by BaseController
|
|
16
|
+
*/
|
|
17
|
+
class TestController extends BaseController_1.default {
|
|
18
|
+
// Expose protected methods for testing
|
|
19
|
+
testInitializeComponents() {
|
|
20
|
+
this.initializeComponents();
|
|
21
|
+
}
|
|
22
|
+
testExecuteSafely(operation, errorMessage) {
|
|
23
|
+
return this.executeSafely(operation, errorMessage);
|
|
24
|
+
}
|
|
25
|
+
testUpdateTargetSafely(target, content, className) {
|
|
26
|
+
this.updateTargetSafely(target, content, className);
|
|
27
|
+
}
|
|
28
|
+
testGenerateInsights() {
|
|
29
|
+
return this.generateInsights();
|
|
30
|
+
}
|
|
31
|
+
testFormatInsightsHTML(insights) {
|
|
32
|
+
return this.formatInsightsHTML(insights);
|
|
33
|
+
}
|
|
34
|
+
testUpdateStatus(target, message, className) {
|
|
35
|
+
this.updateStatus(target, message, className);
|
|
36
|
+
}
|
|
37
|
+
testLogOperation(operation, success = true) {
|
|
38
|
+
this.logOperation(operation, success);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
TestController.targets = ["test"];
|
|
42
|
+
describe('BaseController', () => {
|
|
43
|
+
let controller;
|
|
44
|
+
let mockElement;
|
|
45
|
+
beforeEach(() => {
|
|
46
|
+
controller = new TestController();
|
|
47
|
+
mockElement = document.createElement('div');
|
|
48
|
+
});
|
|
49
|
+
describe('Component Initialization', () => {
|
|
50
|
+
it('should initialize all components correctly', () => {
|
|
51
|
+
controller.testInitializeComponents();
|
|
52
|
+
expect(controller.consciousnessField).toBeInstanceOf(ConsciousnessField_1.ConsciousnessField);
|
|
53
|
+
expect(controller.vortexMath).toBeInstanceOf(VortexMath_1.VortexMath);
|
|
54
|
+
expect(controller.toroidalGeometry).toBeInstanceOf(ToroidalGeometry_1.ToroidalGeometry);
|
|
55
|
+
expect(controller.advancedVBM).toBeInstanceOf(AdvancedVBM_1.AdvancedVBM);
|
|
56
|
+
expect(controller.rodinCoil).toBeInstanceOf(RodinCoil_1.RodinCoil);
|
|
57
|
+
});
|
|
58
|
+
it('should initialize components safely with success', async () => {
|
|
59
|
+
const result = await controller.initializeComponentsSafely();
|
|
60
|
+
expect(result).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
it('should handle initialization errors gracefully', async () => {
|
|
63
|
+
// Mock a component that throws an error
|
|
64
|
+
jest.spyOn(controller, 'initializeComponents').mockImplementation(() => {
|
|
65
|
+
throw new Error('Initialization failed');
|
|
66
|
+
});
|
|
67
|
+
const result = await controller.initializeComponentsSafely();
|
|
68
|
+
expect(result).toBe(false);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe('Display Updates', () => {
|
|
72
|
+
beforeEach(() => {
|
|
73
|
+
controller.testInitializeComponents();
|
|
74
|
+
});
|
|
75
|
+
it('should update consciousness display correctly', () => {
|
|
76
|
+
controller.updateConsciousnessDisplay(mockElement);
|
|
77
|
+
expect(mockElement.textContent).toMatch(/Consciousness: \d+\.\d{3}/);
|
|
78
|
+
});
|
|
79
|
+
it('should update consciousness display with custom level', () => {
|
|
80
|
+
controller.updateConsciousnessDisplay(mockElement, 0.75);
|
|
81
|
+
expect(mockElement.textContent).toBe('Consciousness: 0.750');
|
|
82
|
+
});
|
|
83
|
+
it('should update vortex math display correctly', () => {
|
|
84
|
+
controller.updateVortexMathDisplay(mockElement);
|
|
85
|
+
expect(mockElement.textContent).toMatch(/Vortex Result: \d+\.\d{3}/);
|
|
86
|
+
});
|
|
87
|
+
it('should update vortex math display with custom input', () => {
|
|
88
|
+
controller.updateVortexMathDisplay(mockElement, 42);
|
|
89
|
+
expect(mockElement.textContent).toMatch(/Vortex Result: \d+\.\d{3}/);
|
|
90
|
+
});
|
|
91
|
+
it('should update toroidal geometry display correctly', () => {
|
|
92
|
+
controller.updateToroidalGeometryDisplay(mockElement);
|
|
93
|
+
expect(mockElement.textContent).toMatch(/Toroidal Volume: \d+\.\d{3}/);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
describe('Safe Operations', () => {
|
|
97
|
+
it('should execute operations safely with success', async () => {
|
|
98
|
+
const operation = () => 42;
|
|
99
|
+
const result = await controller.testExecuteSafely(operation, 'Test operation');
|
|
100
|
+
expect(result).toBe(42);
|
|
101
|
+
});
|
|
102
|
+
it('should handle operation errors gracefully', async () => {
|
|
103
|
+
const operation = () => {
|
|
104
|
+
throw new Error('Operation failed');
|
|
105
|
+
};
|
|
106
|
+
const result = await controller.testExecuteSafely(operation, 'Test operation');
|
|
107
|
+
expect(result).toBeNull();
|
|
108
|
+
});
|
|
109
|
+
it('should use default error message when none provided', async () => {
|
|
110
|
+
const operation = () => {
|
|
111
|
+
throw new Error('Operation failed');
|
|
112
|
+
};
|
|
113
|
+
const result = await controller.testExecuteSafely(operation);
|
|
114
|
+
expect(result).toBeNull();
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
describe('Target Updates', () => {
|
|
118
|
+
it('should update target safely with content', () => {
|
|
119
|
+
controller.testUpdateTargetSafely(mockElement, '<p>Test content</p>');
|
|
120
|
+
expect(mockElement.innerHTML).toBe('<p>Test content</p>');
|
|
121
|
+
});
|
|
122
|
+
it('should update target safely with content and className', () => {
|
|
123
|
+
controller.testUpdateTargetSafely(mockElement, '<p>Test content</p>', 'test-class');
|
|
124
|
+
expect(mockElement.innerHTML).toBe('<p>Test content</p>');
|
|
125
|
+
expect(mockElement.className).toBe('test-class');
|
|
126
|
+
});
|
|
127
|
+
it('should handle target update errors gracefully', () => {
|
|
128
|
+
// Mock innerHTML to throw an error
|
|
129
|
+
Object.defineProperty(mockElement, 'innerHTML', {
|
|
130
|
+
set: () => { throw new Error('Update failed'); }
|
|
131
|
+
});
|
|
132
|
+
controller.testUpdateTargetSafely(mockElement, '<p>Test content</p>');
|
|
133
|
+
expect(mockElement.innerHTML).toContain('❌ Update failed');
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
describe('Insights Generation', () => {
|
|
137
|
+
beforeEach(() => {
|
|
138
|
+
controller.testInitializeComponents();
|
|
139
|
+
});
|
|
140
|
+
it('should generate insights with correct structure', () => {
|
|
141
|
+
const insights = controller.testGenerateInsights();
|
|
142
|
+
expect(insights).toHaveProperty('version');
|
|
143
|
+
expect(insights).toHaveProperty('environment');
|
|
144
|
+
expect(insights).toHaveProperty('features');
|
|
145
|
+
expect(insights).toHaveProperty('browser');
|
|
146
|
+
expect(insights).toHaveProperty('consciousness');
|
|
147
|
+
expect(insights.version).toBe('1.0.0');
|
|
148
|
+
expect(insights.environment).toBe('browser');
|
|
149
|
+
expect(Array.isArray(insights.features)).toBe(true);
|
|
150
|
+
expect(typeof insights.browser.userAgent).toBe('string');
|
|
151
|
+
expect(typeof insights.consciousness.level).toBe('number');
|
|
152
|
+
expect(typeof insights.consciousness.field).toBe('number');
|
|
153
|
+
});
|
|
154
|
+
it('should format insights as HTML correctly', () => {
|
|
155
|
+
const insights = controller.testGenerateInsights();
|
|
156
|
+
const html = controller.testFormatInsightsHTML(insights);
|
|
157
|
+
expect(html).toContain('<h3>ZeroPoint Insights</h3>');
|
|
158
|
+
expect(html).toContain(`<strong>Version:</strong> ${insights.version}`);
|
|
159
|
+
expect(html).toContain(`<strong>Environment:</strong> ${insights.environment}`);
|
|
160
|
+
expect(html).toContain(`<strong>Features:</strong> ${insights.features.join(", ")}`);
|
|
161
|
+
expect(html).toContain(`<strong>Browser:</strong> ${insights.browser.userAgent}`);
|
|
162
|
+
expect(html).toContain(`<strong>Consciousness Level:</strong> ${insights.consciousness.level.toFixed(3)}`);
|
|
163
|
+
expect(html).toContain(`<strong>Field Strength:</strong> ${insights.consciousness.field.toFixed(3)}`);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
describe('Status Updates', () => {
|
|
167
|
+
it('should update status correctly', () => {
|
|
168
|
+
controller.testUpdateStatus(mockElement, '✅ Ready', 'status ready');
|
|
169
|
+
expect(mockElement.innerHTML).toBe('✅ Ready');
|
|
170
|
+
expect(mockElement.className).toBe('status ready');
|
|
171
|
+
});
|
|
172
|
+
it('should handle status update errors gracefully', () => {
|
|
173
|
+
// Mock innerHTML to throw an error
|
|
174
|
+
Object.defineProperty(mockElement, 'innerHTML', {
|
|
175
|
+
set: () => { throw new Error('Status update failed'); }
|
|
176
|
+
});
|
|
177
|
+
controller.testUpdateStatus(mockElement, '✅ Ready', 'status ready');
|
|
178
|
+
expect(mockElement.innerHTML).toContain('❌ Update failed');
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
describe('Logging', () => {
|
|
182
|
+
let consoleSpy;
|
|
183
|
+
beforeEach(() => {
|
|
184
|
+
consoleSpy = jest.spyOn(console, 'log').mockImplementation();
|
|
185
|
+
});
|
|
186
|
+
afterEach(() => {
|
|
187
|
+
consoleSpy.mockRestore();
|
|
188
|
+
});
|
|
189
|
+
it('should log successful operations', () => {
|
|
190
|
+
controller.testLogOperation('Test operation', true);
|
|
191
|
+
expect(consoleSpy).toHaveBeenCalledWith('✅ Test operation completed');
|
|
192
|
+
});
|
|
193
|
+
it('should log failed operations', () => {
|
|
194
|
+
controller.testLogOperation('Test operation', false);
|
|
195
|
+
expect(consoleSpy).toHaveBeenCalledWith('❌ Test operation failed');
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
});
|