import { mount } from '@vue/test-utils' import { describe, expect, it } from 'vitest' import SampleLegend from '../../components/SampleLegend.vue' describe('SampleLegend', () => { it('should outline a sample swatch in its group token when no color is given', () => { const wrapper = mount(SampleLegend, { props: { samples: [{ id: 's1', name: 'HeLa' }] } }) const swatch = wrapper.find('.mint-sample-legend__swatch').element as HTMLElement expect(swatch.style.borderColor).toBe('var(--mint-sample-1)') }) it('should draw the QC marker glyph when the sample id is qc', () => { const wrapper = mount(SampleLegend, { props: { samples: [{ id: 'qc', name: 'QC', color: '#8b5cf6' }] } }) expect(wrapper.find('.mint-sample-legend__swatch').text()).toBe('Q') }) })