import { expect, test } from "bun:test"; test("模型行只保留选中高亮,价格使用独立的彩色标签", async () => { const [component, styles, workspace] = await Promise.all([ Bun.file(new URL("../src/components/model-picker.tsx", import.meta.url)).text(), Bun.file(new URL("../src/styles/shared/model-picker.css", import.meta.url)).text(), Bun.file(new URL("../src/styles/workspace-product.css", import.meta.url)).text(), ]); expect(component).not.toContain("previewedModel"); expect(component).not.toContain("onMouseEnter"); expect(styles).not.toMatch(/canvas-model-picker-(?:brand|option)(?:\[[^\]]*\])?:hover/); expect(workspace).not.toContain(".canvas-model-picker-brand.is-active"); expect(styles).toContain('.canvas-model-picker-brand[aria-pressed="true"]'); expect(styles).toContain('.canvas-model-picker-option[aria-selected="true"]'); expect(styles).toContain(".canvas-model-picker-option:focus-visible"); const price = styles.match(/\.model-picker-price \{([^}]+)\}/)?.[1] || ""; expect(price).toContain("color: var(--model-price-ink)"); expect(price).toContain("font-weight: 650"); expect(price).not.toContain("background:"); expect(styles).toContain(".dark .model-picker-price"); const badge = styles.match(/\.canvas-model-picker-option \.model-picker-price \{([^}]+)\}/)?.[1] || ""; expect(badge).toContain("border-radius: var(--r-sm)"); expect(badge).toContain("background: color-mix"); expect(badge).toContain("padding: 2px 5px"); expect(price).toContain("--model-price-ink: #946900"); expect(component).toContain('