diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-13 15:48:59 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-13 15:48:59 -0500 |
| commit | c74c60dcb6df932c6002668f79c363a07cd60238 (patch) | |
| tree | 32c141bcbb9263382b4981fcfce239ecf6f95772 /scripts/theme-studio/test-columns.mjs | |
| parent | 1230868b8e271519530527e1d58be7cdd0f5647c (diff) | |
| download | dotemacs-c74c60dcb6df932c6002668f79c363a07cd60238.tar.gz dotemacs-c74c60dcb6df932c6002668f79c363a07cd60238.zip | |
Treat legacy color names as base columns
Diffstat (limited to 'scripts/theme-studio/test-columns.mjs')
| -rw-r--r-- | scripts/theme-studio/test-columns.mjs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/theme-studio/test-columns.mjs b/scripts/theme-studio/test-columns.mjs index 50a208a3..6079966a 100644 --- a/scripts/theme-studio/test-columns.mjs +++ b/scripts/theme-studio/test-columns.mjs @@ -42,6 +42,21 @@ test('columnsFromPalette: Boundary - legacy two-field entries fall back to name assert.ok(columnOf(columns, 'green')); }); +test('columnsFromPalette: Boundary - legacy color-N entries become separate base columns', () => { + const pal = [['#111111', 'color-22'], ['#222222', 'color-23'], ['#333333', 'color-129']]; + const { columns } = columnsFromPalette(pal, { bg: '#000000', fg: '#ffffff' }); + assert.deepEqual(columns.map(f => f.column), ['color-22', 'color-23', 'color-129']); + assert.deepEqual(columns.map(f => f.members.map(m => m.name)), [['color-22'], ['color-23'], ['color-129']]); +}); + +test('columnsFromPalette: Boundary - explicit color-N column ids are preserved', () => { + const pal = [['#111111', 'color-22', 'captured'], ['#222222', 'color-23', 'captured']]; + const { columns } = columnsFromPalette(pal, { bg: '#000000', fg: '#ffffff' }); + assert.equal(columns.length, 1); + assert.equal(columns[0].column, 'captured'); + assert.deepEqual(columns[0].members.map(m => m.name), ['color-22', 'color-23']); +}); + test('columnsFromPalette: Normal - palette order controls column order', () => { const pal = [['#67809c', 'blue'], ['#e8bd30', 'gold'], ['#5d9b86', 'green']]; const { columns } = columnsFromPalette(pal, { bg: '#000000', fg: '#ffffff' }); |
