|
1 | 1 | import { describe, it, expect } from 'vitest'; |
2 | 2 |
|
3 | 3 | import type { ThemeConfig } from '../../compiler/types'; |
| 4 | + |
4 | 5 | import { surfaceCompilerEntry } from './index'; |
5 | 6 |
|
6 | 7 | describe('Surface Plugin', () => { |
7 | 8 | const baseConfig = { |
8 | 9 | surface: { |
9 | 10 | background: '#ffffff', |
10 | | - foreground: '#000000', |
| 11 | + onBackground: '#000000', |
11 | 12 | card: '#f0f0f0', |
12 | | - darkBackgroundSnippet: '#111111', |
13 | | - darkForegroundSnippet: '#eeeeee', |
14 | | - darkCardSnippet: '#222222', |
| 13 | + onCard: '#111111', |
| 14 | + darkBackground: '#111111', |
| 15 | + darkOnBackground: '#eeeeee', |
| 16 | + darkCard: '#222222', |
| 17 | + darkOnCard: '#ffffff', |
15 | 18 | } |
16 | 19 | } as unknown as ThemeConfig; |
17 | 20 |
|
18 | 21 | it('should emit correct light mode tokens', () => { |
19 | 22 | const tokens = surfaceCompilerEntry.emitTokens(baseConfig); |
20 | 23 | expect(tokens).toContain('--surface-bg: #ffffff'); |
21 | | - expect(tokens).toContain('--surface-fg: #000000'); |
| 24 | + expect(tokens).toContain('--on-background: #000000'); |
| 25 | + expect(tokens).toContain('--surface-card: #f0f0f0'); |
| 26 | + expect(tokens).toContain('--on-card: #111111'); |
22 | 27 | }); |
23 | 28 |
|
24 | 29 | it('should emit correct dark mode tokens', () => { |
25 | 30 | const tokens = surfaceCompilerEntry.emitDarkTokens(baseConfig); |
26 | 31 | expect(tokens).toContain('--surface-bg: #111111'); |
27 | | - expect(tokens).toContain('--surface-fg: #eeeeee'); |
| 32 | + expect(tokens).toContain('--on-background: #eeeeee'); |
| 33 | + expect(tokens).toContain('--surface-card: #222222'); |
| 34 | + expect(tokens).toContain('--on-card: #ffffff'); |
28 | 35 | }); |
29 | 36 | }); |
0 commit comments