test: lock in readable editor theme defaults

This commit is contained in:
冰朔 2026-07-17 11:15:45 +08:00
parent 5dcdcd8a6b
commit 59ce6261d3

View File

@ -3,11 +3,11 @@ import { renderHook } from '@testing-library/react'
import { useEditorTheme } from './useTheme' import { useEditorTheme } from './useTheme'
describe('useEditorTheme', () => { describe('useEditorTheme', () => {
it('keeps inline code on the muted editor surface without exporting code block overrides', () => { it('gives inline code a subtle accent surface without exporting code block overrides', () => {
const { result } = renderHook(() => useEditorTheme()) const { result } = renderHook(() => useEditorTheme())
expect(result.current.cssVars['--inline-styles-code-background-color']).toBe( expect(result.current.cssVars['--inline-styles-code-background-color']).toBe(
'var(--bg-hover-subtle)' 'color-mix(in srgb, var(--accent-blue) 11%, var(--bg-hover-subtle))'
) )
expect(result.current.cssVars['--code-blocks-background-color']).toBeUndefined() expect(result.current.cssVars['--code-blocks-background-color']).toBeUndefined()
}) })
@ -27,6 +27,6 @@ describe('useEditorTheme', () => {
it('exports the default editor max width', () => { it('exports the default editor max width', () => {
const { result } = renderHook(() => useEditorTheme()) const { result } = renderHook(() => useEditorTheme())
expect(result.current.cssVars['--editor-max-width']).toBe('820px') expect(result.current.cssVars['--editor-max-width']).toBe('880px')
}) })
}) })