import { describe, it, expect } from 'vitest' import { classKey } from '../../../composables/autoGroup/classKey' describe('classKey', () => { it('should key by kind alone when there is no subKind', () => { expect(classKey({ kind: 'unknown' })).toBe('unknown') }) it('should key by kind:subKind when a subKind is present', () => { expect(classKey({ kind: 'biological', subKind: 'Plasma' })).toBe('biological:Plasma') }) it('should append the token length so length-split classes get distinct keys', () => { expect(classKey({ kind: 'biological', subKind: 'Plasma', tokenLength: 7 })).toBe( 'biological:Plasma#7', ) expect(classKey({ kind: 'biological', subKind: 'Plasma', tokenLength: 8 })).toBe( 'biological:Plasma#8', ) }) it('should append the token length even without a subKind', () => { expect(classKey({ kind: 'unknown', tokenLength: 3 })).toBe('unknown#3') }) })