loads of UI improvements, also improves the console UI
This commit is contained in:
@@ -3,6 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import { DEFAULTS, getConfig, getThemeCss, resolveConfig } from '../src/main/config'
|
||||
import { DEFAULT_CONFIG as RENDERER_DEFAULTS } from '../src/renderer/src/types'
|
||||
|
||||
let dir = ''
|
||||
afterEach(async () => { if (dir) await rm(dir, { recursive: true, force: true }) })
|
||||
@@ -52,3 +53,18 @@ describe('resolveConfig', () => {
|
||||
expect(getThemeCss()).toContain('#ff0000')
|
||||
})
|
||||
})
|
||||
|
||||
describe('terminal defaults', () => {
|
||||
it('mirrors the main-process schema in the renderer', () => {
|
||||
// Two copies of one schema drift silently; the terminal block is the one
|
||||
// the user edits by hand, so it is worth asserting they still agree.
|
||||
expect(RENDERER_DEFAULTS.terminal).toEqual(DEFAULTS.terminal)
|
||||
})
|
||||
it('carries a full ANSI table, so a partial config.json still resolves', () => {
|
||||
const t = DEFAULTS.terminal.theme
|
||||
for (const key of ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'] as const) {
|
||||
expect(t[key]).toMatch(/^#[0-9a-f]{6}$/i)
|
||||
expect(t[`bright${key[0].toUpperCase()}${key.slice(1)}` as keyof typeof t]).toMatch(/^#[0-9a-f]{6}$/i)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user