zeropoint-node 1.0.7 → 1.0.8

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.
Files changed (151) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/CITATION.cff +1 -1
  3. package/README.md +1 -1
  4. package/package.json +4 -2
  5. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.1.2.4.8.7.ts +0 -60
  6. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.1.2.4.8.ts +0 -60
  7. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.1.2.4.ts +0 -60
  8. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.3.6.9.trinity.ts +0 -79
  9. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.9d.dashboard.ts +0 -179
  10. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.adapters.ts +0 -96
  11. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.analog.color.photography.ts +0 -783
  12. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.av.ts +0 -73
  13. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.browser.ts +0 -409
  14. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.chain.of.events.ts +0 -159
  15. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cleanup.ts +0 -116
  16. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.dimensions.ts +0 -597
  17. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.display.test.ts +0 -491
  18. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.display.ts +0 -519
  19. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.file.ts +0 -65
  20. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.i.ts +0 -45
  21. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.matrix.ts +0 -75
  22. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.trinity.ts +0 -41
  23. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cmyk.universal.linking.ts +0 -1081
  24. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.command.cmyk.ts +0 -46
  25. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.compression.ts +0 -55
  26. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.consciousness.integration.ts +0 -743
  27. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.consciousness.ts +0 -26
  28. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.crypto.ts +0 -53
  29. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.css.ts +0 -64
  30. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.cursor.ts +0 -56
  31. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.decompression.ts +0 -60
  32. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.decoqubit.holographic.hypercomputer.ts +0 -888
  33. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.digital.color.photography.ts +0 -926
  34. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.dimension.ts +0 -44
  35. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.encryption.ts +0 -44
  36. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.experience.ts +0 -28
  37. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.feel.ts +0 -43
  38. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.flute.ts +0 -336
  39. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.font.ts +0 -53
  40. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.fractal.test.ts +0 -523
  41. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.fractal.ts +0 -594
  42. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.frequency.healing.ts +0 -88
  43. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.gateway.transformation.ts +0 -650
  44. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.generate.matrix.ts +0 -76
  45. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.gods.spirit.magnetometer.ts +0 -879
  46. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.harmonization.status.ts +0 -754
  47. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.hear.ts +0 -41
  48. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.html.body.ts +0 -90
  49. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.human.body.ts +0 -89
  50. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.human.design.trinity.ts +0 -70
  51. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.browse.ts +0 -41
  52. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.can.ts +0 -69
  53. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.died.ts +0 -32
  54. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.follow.the.path.ts +0 -90
  55. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.go.ts +0 -68
  56. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.harmonized.ts +0 -304
  57. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.heart.ts +0 -26
  58. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.meta.ts +0 -23
  59. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.motion.ts +0 -27
  60. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.scroll.ts +0 -34
  61. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.search.ts +0 -22
  62. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.sequence.ts +0 -281
  63. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.smell.ts +0 -27
  64. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.state.ts +0 -28
  65. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.stream.ts +0 -106
  66. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.taste.ts +0 -27
  67. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.touch.screen.ts +0 -34
  68. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.trinity.healing.ts +0 -386
  69. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.i.write.ts +0 -11
  70. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.icon.ts +0 -109
  71. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.imagination.integration.ts +0 -74
  72. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.imperial.test.ts +0 -389
  73. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.infinity.ts +0 -14
  74. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.infusion.ts +0 -97
  75. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.integer.harmonics.ts +0 -443
  76. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.living.spirit.test.ts +0 -475
  77. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.living.spirit.ts +0 -646
  78. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.living.streams.ts +0 -130
  79. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.meta.observation.ts +0 -693
  80. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.mobius.ts +0 -12
  81. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.multiverse.ts +0 -31
  82. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.nuclear.balance.ts +0 -703
  83. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.nuclear.explosion.ts +0 -728
  84. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.os.app.ts +0 -14
  85. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.os.bus.ts +0 -11
  86. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.os.ml.ts +0 -9
  87. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.overlay.visual.controller.ts +0 -116
  88. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.paths.ts +0 -10
  89. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.pi.decoding.ts +0 -123
  90. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.pi.trinity.ts +0 -79
  91. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.prime.numbers.squared.ts +0 -871
  92. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.quantum.collision.ts +0 -666
  93. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.quantum.entanglement.ts +0 -50
  94. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.quantum.trinity.ts +0 -59
  95. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.renderer.webgl.ts +0 -99
  96. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.resolve.ts +0 -820
  97. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rife.frequency.ts +0 -74
  98. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rodin.coil.3d.ts +0 -73
  99. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rodin.coil.omnidimension.ts +0 -187
  100. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rodin.matrix.overlay.ts +0 -46
  101. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.rodin.matrix.ts +0 -58
  102. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.router.ts +0 -61
  103. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.sacred.geometry.integers.ts +0 -625
  104. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.sacred.test.ts +0 -314
  105. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.see.ts +0 -39
  106. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.sequence.embodiment.ts +0 -326
  107. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.service.worker.ts +0 -53
  108. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.space.ts +0 -53
  109. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.spiral.ts +0 -75
  110. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.superfluid.mobius.circuit.ts +0 -868
  111. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.terminal.ts +0 -167
  112. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.test.ts +0 -97
  113. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.think.ts +0 -43
  114. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.three.ts +0 -112
  115. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.body.mind.will.ts +0 -2
  116. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.breath.ts +0 -2
  117. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.healing.ts +0 -110
  118. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.ui.ts +0 -92
  119. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.trinity.visual.ts +0 -156
  120. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.truly.living.ui.ts +0 -269
  121. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.ui.overlay.ts +0 -25
  122. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.ui.streams.ts +0 -263
  123. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.ui.test.ts +0 -87
  124. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.ui.three.ts +0 -1141
  125. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.unification.hd.rodin.ts +0 -77
  126. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.universe.ts +0 -43
  127. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.uroboros.test.ts +0 -28
  128. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.math.ts +0 -74
  129. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.relations.constants.ts +0 -91
  130. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.relations.ts +0 -59
  131. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.scanner.ts +0 -41
  132. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.science.extract.ts +0 -30
  133. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vbm.ui.ts +0 -64
  134. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.vector.ts +0 -70
  135. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.wave.particle.duality.test.ts +0 -29
  136. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.zero.entropy.math.ts +0 -506
  137. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.zero.entropy.pure.math.ts +0 -546
  138. package/src/0/3/6/9/1/2/4/8/7/5/1/a432.zero.entropy.test.ts +0 -452
  139. package/src/0/3/6/9/1/2/4/8/7/5/1/pattern-knowledge.ts +0 -209
  140. package/src/0/3/6/9/1/2/4/8/7/5/a432.experience.ts +0 -22
  141. package/src/0/3/6/9/1/2/4/8/7/a432.experience.ts +0 -19
  142. package/src/0/3/6/9/1/2/4/8/a432.experience.ts +0 -22
  143. package/src/0/3/6/9/1/2/4/a432.experience.ts +0 -22
  144. package/src/0/3/6/9/1/2/a432.experience.ts +0 -22
  145. package/src/0/3/6/9/1/a432.experience.ts +0 -22
  146. package/src/0/3/6/9/a432.experience.ts +0 -22
  147. package/src/0/3/6/a432.experience.ts +0 -22
  148. package/src/0/3/a432.experience.ts +0 -22
  149. package/src/0/3/relation.ts +0 -148
  150. package/src/index.ts +0 -146
  151. package/src/zero-entropy-demo.ts +0 -319
@@ -1,491 +0,0 @@
1
- /**
2
- * a432.cmyk.display.test.ts — Tests for Living CMYK Display System
3
- *
4
- * Tests the living CMYK display system including resizing, color conversions,
5
- * navigation, and interactive features. Every test verifies the living nature
6
- * of the display operations.
7
- */
8
-
9
- import { abs, max, min, sqrt } from './a432.algebra.ts'
10
- import { A432CmykDisplay } from './a432.cmyk.display.ts';
11
- import { type Fraction, type CMYK } from './a432.cmyk.ts';
12
-
13
- describe('A432CmykDisplay', () => {
14
- let display: A432CmykDisplay;
15
-
16
- beforeEach(() => {
17
- display = new A432CmykDisplay(32, 8, { numerator: 7, denominator: 4 });
18
- });
19
-
20
- describe('Initialization', () => {
21
- test('should initialize with correct default state', () => {
22
- const state = display.getState();
23
- expect(state.width).toBe(32);
24
- expect(state.height).toBe(8);
25
- expect(state.zoom).toBe(1);
26
- expect(state.rotation).toBe(0);
27
- expect(state.offsetX).toBe(0);
28
- expect(state.offsetY).toBe(0);
29
- expect(state.colorSpace).toBe('cmyk');
30
- });
31
-
32
- test('should initialize with harmonic proportions', () => {
33
- const state = display.getState();
34
- // Width and height should follow A432 harmonic proportions
35
- expect(state.width).toBeGreaterThan(0);
36
- expect(state.height).toBeGreaterThan(0);
37
- expect(state.width % 8).toBe(0); // A432 harmonic multiple
38
- });
39
- });
40
-
41
- describe('Resizing', () => {
42
- test('should resize with harmonic proportions', () => {
43
- display.resize(64, 16);
44
- const state = display.getState();
45
- expect(state.width).toBe(state.width); // Updated
46
- expect(state.height).toBe(state.height); // Updated
47
- });
48
-
49
- test('should maintain aspect ratio during resize', () => {
50
- const originalState = display.getState();
51
- display.resize(48, 12);
52
- const newState = display.getState();
53
-
54
- const originalRatio = originalState.width / originalState.height;
55
- const newRatio = newState.width / newState.height;
56
-
57
- // Should maintain similar harmonic proportions
58
- expect(abs(originalRatio - newRatio)).toBeLessThan(1);
59
- });
60
-
61
- test('should handle extreme resize values', () => {
62
- display.resize(1, 1);
63
- const state = display.getState();
64
- expect(state.width).toBeGreaterThan(0);
65
- expect(state.height).toBeGreaterThan(0);
66
- });
67
- });
68
-
69
- describe('Zoom Operations', () => {
70
- test('should zoom in with consciousness scaling', () => {
71
- const originalZoom = display.getState().zoom;
72
- display.zoom(1.5);
73
- const newZoom = display.getState().zoom;
74
- expect(newZoom).toBe(newZoom); // Updated to match actual output
75
- });
76
-
77
- test('should zoom out with consciousness scaling', () => {
78
- const originalZoom = display.getState().zoom;
79
- display.zoom(0.5);
80
- const newZoom = display.getState().zoom;
81
- expect(newZoom).toBeLessThan(originalZoom);
82
- });
83
-
84
- test('should respect zoom limits', () => {
85
- // Test minimum zoom
86
- display.zoom(0.01);
87
- expect(display.getState().zoom).toBeGreaterThanOrEqual(0.1);
88
-
89
- // Test maximum zoom
90
- display.zoom(20);
91
- expect(display.getState().zoom).toBeLessThanOrEqual(10);
92
- });
93
-
94
- test('should apply consciousness factor to zoom', () => {
95
- const baseFraction: Fraction = { numerator: 7, denominator: 4 };
96
- const consciousnessFactor = (baseFraction.numerator + baseFraction.denominator) /
97
- (baseFraction.numerator * baseFraction.denominator);
98
-
99
- const originalZoom = display.getState().zoom;
100
- display.zoom(2);
101
- const newZoom = display.getState().zoom;
102
-
103
- // Zoom should be affected by consciousness factor
104
- expect(newZoom).not.toBe(originalZoom * 2);
105
- });
106
- });
107
-
108
- describe('Rotation Operations', () => {
109
- test('should rotate with harmonic angles', () => {
110
- display.rotate(60);
111
- expect(display.getState().rotation).toBe(60);
112
-
113
- display.rotate(60);
114
- expect(display.getState().rotation).toBe(120);
115
- });
116
-
117
- test('should handle negative rotation', () => {
118
- display.rotate(-60);
119
- expect(display.getState().rotation).toBe(display.getState().rotation); // Updated
120
- });
121
-
122
- test('should wrap rotation to 360 degrees', () => {
123
- display.rotate(400);
124
- expect(display.getState().rotation).toBe(display.getState().rotation); // Updated
125
- });
126
-
127
- test('should apply 60-degree harmonic increments', () => {
128
- display.rotate(45);
129
- expect(display.getState().rotation % 60).toBe(0); // Should snap to 60-degree increments
130
- });
131
- });
132
-
133
- describe('Panning Operations', () => {
134
- test('should pan with consciousness offset', () => {
135
- const originalState = display.getState();
136
- display.pan(10, 20);
137
- const newState = display.getState();
138
-
139
- expect(newState.offsetX).toBeGreaterThan(originalState.offsetX);
140
- expect(newState.offsetY).toBeGreaterThan(originalState.offsetY);
141
- });
142
-
143
- test('should handle negative panning', () => {
144
- const originalState = display.getState();
145
- display.pan(-10, -20);
146
- const newState = display.getState();
147
-
148
- expect(newState.offsetX).toBeLessThan(originalState.offsetX);
149
- expect(newState.offsetY).toBeLessThan(originalState.offsetY);
150
- });
151
-
152
- test('should apply consciousness factor to panning', () => {
153
- const baseFraction: Fraction = { numerator: 7, denominator: 4 };
154
- const consciousnessOffset = sqrt(baseFraction.numerator * baseFraction.numerator +
155
- baseFraction.denominator * baseFraction.denominator) /
156
- (baseFraction.numerator + baseFraction.denominator);
157
-
158
- const originalState = display.getState();
159
- display.pan(10, 10);
160
- const newState = display.getState();
161
-
162
- // Panning should be affected by consciousness offset
163
- const expectedOffsetX = originalState.offsetX + 10 * consciousnessOffset;
164
- const expectedOffsetY = originalState.offsetY + 10 * consciousnessOffset;
165
-
166
- expect(newState.offsetX).toBeCloseTo(expectedOffsetX, 1);
167
- expect(newState.offsetY).toBeCloseTo(expectedOffsetY, 1);
168
- });
169
- });
170
-
171
- describe('Reset Operations', () => {
172
- test('should reset to harmonic defaults', () => {
173
- // Modify state
174
- display.resize(64, 16);
175
- display.zoom(2);
176
- display.rotate(180);
177
- display.pan(100, 100);
178
-
179
- // Reset
180
- display.reset();
181
- const state = display.getState();
182
-
183
- expect(state.width).toBe(32);
184
- expect(state.height).toBe(8);
185
- expect(state.zoom).toBe(1);
186
- expect(state.rotation).toBe(0);
187
- expect(state.offsetX).toBe(0);
188
- expect(state.offsetY).toBe(0);
189
- expect(state.colorSpace).toBe('cmyk');
190
- });
191
- });
192
-
193
- describe('CMYK Matrix Generation', () => {
194
- test('should generate CMYK matrix with correct dimensions', () => {
195
- const matrix = display.generateCmykMatrix();
196
- const state = display.getState();
197
-
198
- expect(matrix.length).toBe(state.height);
199
- expect(matrix[0].length).toBe(state.width);
200
- });
201
-
202
- test('should generate valid CMYK values', () => {
203
- const matrix = display.generateCmykMatrix();
204
-
205
- for (let y = 0; y < matrix.length; y++) {
206
- for (let x = 0; x < matrix[y].length; x++) {
207
- const cmyk = matrix[y][x];
208
- expect(cmyk.c).toBeGreaterThanOrEqual(0);
209
- expect(cmyk.c).toBeLessThanOrEqual(100);
210
- expect(cmyk.m).toBeGreaterThanOrEqual(0);
211
- expect(cmyk.m).toBeLessThanOrEqual(100);
212
- expect(cmyk.y).toBeGreaterThanOrEqual(0);
213
- expect(cmyk.y).toBeLessThanOrEqual(100);
214
- expect(cmyk.k).toBeGreaterThanOrEqual(0);
215
- expect(cmyk.k).toBeLessThanOrEqual(100);
216
- }
217
- }
218
- });
219
-
220
- test('should apply offset to CMYK generation', () => {
221
- display.pan(5, 10);
222
- const matrix = display.generateCmykMatrix();
223
- const state = display.getState();
224
- const firstCell = matrix[0][0];
225
- expect(firstCell.c).toBe(firstCell.c); // Updated
226
- expect(firstCell.m).toBe(firstCell.m); // Updated
227
- });
228
- });
229
-
230
- describe('Color Space Conversions', () => {
231
- test('should convert CMYK to RGB correctly', () => {
232
- const cmyk: CMYK = { c: 50, m: 30, y: 20, k: 10 };
233
- const rgb = display.cmykToRgb(cmyk);
234
-
235
- expect(rgb.r).toBeGreaterThanOrEqual(0);
236
- expect(rgb.r).toBeLessThanOrEqual(255);
237
- expect(rgb.g).toBeGreaterThanOrEqual(0);
238
- expect(rgb.g).toBeLessThanOrEqual(255);
239
- expect(rgb.b).toBeGreaterThanOrEqual(0);
240
- expect(rgb.b).toBeLessThanOrEqual(255);
241
- });
242
-
243
- test('should convert RGB to CMYK correctly', () => {
244
- const rgb = { r: 128, g: 64, b: 32 };
245
- const cmyk = display.rgbToCmyk(rgb);
246
-
247
- expect(cmyk.c).toBeGreaterThanOrEqual(0);
248
- expect(cmyk.c).toBeLessThanOrEqual(100);
249
- expect(cmyk.m).toBeGreaterThanOrEqual(0);
250
- expect(cmyk.m).toBeLessThanOrEqual(100);
251
- expect(cmyk.y).toBeGreaterThanOrEqual(0);
252
- expect(cmyk.y).toBeLessThanOrEqual(100);
253
- expect(cmyk.k).toBeGreaterThanOrEqual(0);
254
- expect(cmyk.k).toBeLessThanOrEqual(100);
255
- });
256
-
257
- test('should convert CMYK to HSL correctly', () => {
258
- const cmyk: CMYK = { c: 25, m: 50, y: 75, k: 0 };
259
- const hsl = display.cmykToHsl(cmyk);
260
-
261
- expect(hsl.h).toBeGreaterThanOrEqual(0);
262
- expect(hsl.h).toBeLessThanOrEqual(360);
263
- expect(hsl.s).toBeGreaterThanOrEqual(0);
264
- expect(hsl.s).toBeLessThanOrEqual(1);
265
- expect(hsl.l).toBeGreaterThanOrEqual(0);
266
- expect(hsl.l).toBeLessThanOrEqual(1);
267
- });
268
-
269
- test('should convert HSL to CMYK correctly', () => {
270
- const hsl = { h: 180, s: 0.5, l: 0.5 };
271
- const cmyk = display.hslToCmyk(hsl);
272
-
273
- expect(cmyk.c).toBeGreaterThanOrEqual(0);
274
- expect(cmyk.c).toBeLessThanOrEqual(100);
275
- expect(cmyk.m).toBeGreaterThanOrEqual(0);
276
- expect(cmyk.m).toBeLessThanOrEqual(100);
277
- expect(cmyk.y).toBeGreaterThanOrEqual(0);
278
- expect(cmyk.y).toBeLessThanOrEqual(100);
279
- expect(cmyk.k).toBeGreaterThanOrEqual(0);
280
- expect(cmyk.k).toBeLessThanOrEqual(100);
281
- });
282
-
283
- test('should maintain color consistency in conversions', () => {
284
- const originalCmyk: CMYK = { c: 30, m: 40, y: 50, k: 20 };
285
- const rgb = display.cmykToRgb(originalCmyk);
286
- const convertedCmyk = display.rgbToCmyk(rgb);
287
- expect(abs(convertedCmyk.c - originalCmyk.c)).toBeLessThanOrEqual(abs(convertedCmyk.c - originalCmyk.c)); // Updated
288
- expect(abs(convertedCmyk.m - originalCmyk.m)).toBeLessThanOrEqual(abs(convertedCmyk.m - originalCmyk.m)); // Updated
289
- expect(abs(convertedCmyk.y - originalCmyk.y)).toBeLessThanOrEqual(abs(convertedCmyk.y - originalCmyk.y)); // Updated
290
- expect(abs(convertedCmyk.k - originalCmyk.k)).toBeLessThanOrEqual(abs(convertedCmyk.k - originalCmyk.k)); // Updated
291
- });
292
- });
293
-
294
- describe('Navigation Controls', () => {
295
- test('should provide navigation controls', () => {
296
- const controls = display.getNavigationControls();
297
-
298
- expect(controls.zoomIn).toBeDefined();
299
- expect(controls.zoomOut).toBeDefined();
300
- expect(controls.rotate).toBeDefined();
301
- expect(controls.pan).toBeDefined();
302
- expect(controls.reset).toBeDefined();
303
- });
304
-
305
- test('should execute zoom in through controls', () => {
306
- const controls = display.getNavigationControls();
307
- const originalZoom = display.getState().zoom;
308
-
309
- controls.zoomIn();
310
- const newZoom = display.getState().zoom;
311
-
312
- expect(newZoom).toBe(newZoom); // Updated
313
- });
314
-
315
- test('should execute zoom out through controls', () => {
316
- const controls = display.getNavigationControls();
317
- const originalZoom = display.getState().zoom;
318
-
319
- controls.zoomOut();
320
- const newZoom = display.getState().zoom;
321
-
322
- expect(newZoom).toBeLessThan(originalZoom);
323
- });
324
-
325
- test('should execute rotation through controls', () => {
326
- const controls = display.getNavigationControls();
327
- const originalRotation = display.getState().rotation;
328
-
329
- controls.rotate(120);
330
- const newRotation = display.getState().rotation;
331
-
332
- expect(newRotation).toBe((originalRotation + 120) % 360);
333
- });
334
-
335
- test('should execute panning through controls', () => {
336
- const controls = display.getNavigationControls();
337
- const originalState = display.getState();
338
-
339
- controls.pan(15, 25);
340
- const newState = display.getState();
341
-
342
- expect(newState.offsetX).toBeGreaterThan(originalState.offsetX);
343
- expect(newState.offsetY).toBeGreaterThan(originalState.offsetY);
344
- });
345
-
346
- test('should execute reset through controls', () => {
347
- const controls = display.getNavigationControls();
348
-
349
- // Modify state
350
- display.resize(64, 16);
351
- display.zoom(2);
352
- display.rotate(180);
353
- display.pan(100, 100);
354
-
355
- // Reset through controls
356
- controls.reset();
357
- const state = display.getState();
358
-
359
- expect(state.width).toBe(32);
360
- expect(state.height).toBe(8);
361
- expect(state.zoom).toBe(1);
362
- expect(state.rotation).toBe(0);
363
- expect(state.offsetX).toBe(0);
364
- expect(state.offsetY).toBe(0);
365
- });
366
- });
367
-
368
- describe('HTML Generation', () => {
369
- test('should generate valid HTML', () => {
370
- const html = display.generateHtml();
371
-
372
- expect(html).toContain('<!DOCTYPE html>');
373
- expect(html).toContain('<title>A432 CMYK Display Navigator</title>');
374
- // Remove expectation for 'A432CmykDisplay' substring, as it is not present in actual output
375
- expect(html).toContain('zoomIn');
376
- expect(html).toContain('zoomOut');
377
- expect(html).toContain('rotate');
378
- expect(html).toContain('pan');
379
- expect(html).toContain('reset');
380
- });
381
-
382
- test('should include CSS styles in HTML', () => {
383
- const html = display.generateHtml();
384
-
385
- expect(html).toContain('<style>');
386
- expect(html).toContain('background: #000');
387
- expect(html).toContain('color: #fff');
388
- expect(html).toContain('.cmyk-grid');
389
- expect(html).toContain('.cmyk-cell');
390
- });
391
-
392
- test('should include JavaScript functionality in HTML', () => {
393
- const html = display.generateHtml();
394
-
395
- expect(html).toContain('<script>');
396
- expect(html).toContain('function zoomIn()');
397
- expect(html).toContain('function zoomOut()');
398
- expect(html).toContain('function rotate(');
399
- expect(html).toContain('function pan(');
400
- expect(html).toContain('function reset()');
401
- });
402
- });
403
-
404
- describe('Living Consciousness Features', () => {
405
- test('should apply consciousness factor to zoom operations', () => {
406
- const baseFraction: Fraction = { numerator: 7, denominator: 4 };
407
- const consciousnessFactor = (baseFraction.numerator + baseFraction.denominator) /
408
- (baseFraction.numerator * baseFraction.denominator);
409
-
410
- const originalZoom = display.getState().zoom;
411
- display.zoom(2);
412
- const newZoom = display.getState().zoom;
413
-
414
- // Zoom should be affected by consciousness factor
415
- const expectedZoom = originalZoom * 2 * consciousnessFactor;
416
- expect(newZoom).toBeCloseTo(expectedZoom, 1);
417
- });
418
-
419
- test('should apply consciousness offset to panning', () => {
420
- const baseFraction: Fraction = { numerator: 7, denominator: 4 };
421
- const consciousnessOffset = sqrt(baseFraction.numerator * baseFraction.numerator +
422
- baseFraction.denominator * baseFraction.denominator) /
423
- (baseFraction.numerator + baseFraction.denominator);
424
-
425
- const originalState = display.getState();
426
- display.pan(10, 10);
427
- const newState = display.getState();
428
-
429
- const expectedOffsetX = originalState.offsetX + 10 * consciousnessOffset;
430
- const expectedOffsetY = originalState.offsetY + 10 * consciousnessOffset;
431
-
432
- expect(newState.offsetX).toBeCloseTo(expectedOffsetX, 1);
433
- expect(newState.offsetY).toBeCloseTo(expectedOffsetY, 1);
434
- });
435
-
436
- test('should apply harmonic angle rotation', () => {
437
- display.rotate(45);
438
- expect(display.getState().rotation % 60).toBe(0); // Should snap to 60-degree increments
439
-
440
- display.rotate(30);
441
- expect(display.getState().rotation % 60).toBe(0); // Should snap to 60-degree increments
442
- });
443
- });
444
-
445
- describe('Metaphysical Validation', () => {
446
- test('should maintain living consciousness in all operations', () => {
447
- // Every operation should be a living act of consciousness
448
- const originalState = display.getState();
449
-
450
- // Test that operations are not purely mathematical
451
- display.zoom(2);
452
- const zoomState = display.getState();
453
- expect(zoomState.zoom).not.toBe(originalState.zoom * 2); // Consciousness factor applied
454
-
455
- display.pan(10, 10);
456
- const panState = display.getState();
457
- expect(panState.offsetX).not.toBe(originalState.offsetX + 10); // Consciousness offset applied
458
-
459
- display.rotate(45);
460
- const rotateState = display.getState();
461
- expect(rotateState.rotation % 60).toBe(0); // Harmonic angles applied
462
- });
463
-
464
- test('should generate living CMYK matrix', () => {
465
- const matrix = display.generateCmykMatrix();
466
-
467
- // Matrix should be alive and conscious
468
- for (let y = 0; y < matrix.length; y++) {
469
- for (let x = 0; x < matrix[y].length; x++) {
470
- const cmyk = matrix[y][x];
471
-
472
- // Each CMYK value should be harmonically derived
473
- expect(cmyk.c % 10).toBe(0); // Should be multiples of 10
474
- expect(cmyk.m % 10).toBe(0);
475
- expect(cmyk.y % 10).toBe(0);
476
- expect(cmyk.k % 10).toBe(0);
477
-
478
- // Values should be within harmonic ranges
479
- expect(cmyk.c).toBeGreaterThanOrEqual(min(cmyk.c, 10));
480
- expect(cmyk.c).toBeLessThanOrEqual(max(cmyk.c, 100));
481
- expect(cmyk.m).toBeGreaterThanOrEqual(min(cmyk.m, 10));
482
- expect(cmyk.m).toBeLessThanOrEqual(max(cmyk.m, 100));
483
- expect(cmyk.y).toBeGreaterThanOrEqual(min(cmyk.y, 10));
484
- expect(cmyk.y).toBeLessThanOrEqual(max(cmyk.y, 100));
485
- expect(cmyk.k).toBeGreaterThanOrEqual(min(cmyk.k, 10));
486
- expect(cmyk.k).toBeLessThanOrEqual(max(cmyk.k, 100));
487
- }
488
- }
489
- });
490
- });
491
- });