aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/test-columns.mjs
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-13 18:19:25 -0500
committerCraig Jennings <c@cjennings.net>2026-06-13 18:19:25 -0500
commit749cb0885872571b36d9b3174067911a47fd5e3b (patch)
tree4253b675c96dcdf78639611e4b57f66813929b7a /scripts/theme-studio/test-columns.mjs
parentd0cf30bfa37864db12009c2f561c87f96bd66989 (diff)
downloaddotemacs-749cb0885872571b36d9b3174067911a47fd5e3b.tar.gz
dotemacs-749cb0885872571b36d9b3174067911a47fd5e3b.zip
Fix theme studio span endpoint tiles
Diffstat (limited to 'scripts/theme-studio/test-columns.mjs')
-rw-r--r--scripts/theme-studio/test-columns.mjs14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/theme-studio/test-columns.mjs b/scripts/theme-studio/test-columns.mjs
index 4f5ae6a0..ae4cfcce 100644
--- a/scripts/theme-studio/test-columns.mjs
+++ b/scripts/theme-studio/test-columns.mjs
@@ -79,11 +79,11 @@ test('columnsFromPalette: Boundary - ground hex absent from the palette still fo
assert.ok(ground.some(g => g.role === 'fg'));
});
-test('columnsFromPalette: Boundary - ground entries and ground-N steps stay out of normal columns', () => {
- const pal = [['#0d0b0a', 'bg', 'ground'], ['#444444', 'ground-1', 'ground'], ['#67809c', 'blue']];
+test('columnsFromPalette: Boundary - ground entries and ground+N steps stay out of normal columns', () => {
+ const pal = [['#0d0b0a', 'bg', 'ground'], ['#444444', 'ground+1', 'ground'], ['#67809c', 'blue']];
const { ground, columns } = columnsFromPalette(pal, { bg: '#0d0b0a', fg: '#f0fef0' });
assert.ok(ground.some(g => g.hex.toLowerCase() === '#0d0b0a'));
- assert.ok(!columns.some(f => f.members.some(m => m.name === 'bg' || m.name === 'ground-1')));
+ assert.ok(!columns.some(f => f.members.some(m => m.name === 'bg' || m.name === 'ground+1')));
});
test('columnsFromPalette: Boundary - imported bg-like names are not ground just because their hex matches bg', () => {
@@ -108,7 +108,8 @@ test('groundRoleOfEntry: Boundary - exact ground roles only, not bg-prefix names
assert.equal(groundRoleOfEntry(['#0d0b0a', 'ground'], ground), 'bg');
assert.equal(groundRoleOfEntry(['#0d0b0a', 'bg2'], ground), null);
assert.equal(groundRoleOfEntry(['#0d0b0a', 'bg-alt'], ground), null);
- assert.equal(groundRoleOfEntry(['#444444', 'ground-1'], ground), 'step');
+ assert.equal(groundRoleOfEntry(['#444444', 'ground+1'], ground), 'step');
+ assert.equal(groundRoleOfEntry(['#555555', 'ground-1'], ground), 'step');
});
// --- regenColumn ------------------------------------------------------------
@@ -129,6 +130,11 @@ test('regenColumn: Error - a malformed base returns a structured bad-hex', () =>
assert.deepEqual(regenColumn('nope', 2), { members: [], error: 'bad-hex' });
});
+test('regenColumn: Boundary - generated pure white and black endpoint steps are skipped', () => {
+ assert.ok(!regenColumn('#e0e0e0', 4).members.some(m => m.offset !== 0 && m.hex === '#ffffff'));
+ assert.ok(!regenColumn('#101010', 4).members.some(m => m.offset !== 0 && m.hex === '#000000'));
+});
+
// --- rankByLightness --------------------------------------------------------
test('rankByLightness: Normal - offsets are signed distance from the base by lightness', () => {