mirror of
https://github.com/kevinkickback/Combo-Colors.git
synced 2026-07-22 11:50:29 +00:00
- Introduced functions for cloning profiles and creating default settings. - Added validation for profile IDs and input names, ensuring they meet specific criteria. - Implemented color validation for CSS colors to ensure safe usage. - Enhanced settings merging logic to prevent mutation of default settings. - Added new classes for managing styles dynamically based on profiles. - Implemented a mode toggle for rendering notations as images or text. - Created a notation observer to handle dynamic updates in the UI. - Added comprehensive tests for input validation, profile validation, and mode toggling functionality. - Removed deprecated button styling from CSS.
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
canonicalMotionMap,
|
|
generateButtonMap,
|
|
getMissingCanonicalMotionConfigs,
|
|
} from '../src/patterns'
|
|
|
|
const testProfile = {
|
|
name: 'Test Profile',
|
|
desc: {
|
|
A: 'Light attack',
|
|
LP: 'Light punch',
|
|
K: 'Kick',
|
|
},
|
|
colors: {
|
|
A: '#ffffff',
|
|
LP: '#eeeeee',
|
|
K: '#dddddd',
|
|
},
|
|
}
|
|
|
|
describe('patterns', () => {
|
|
it('creates a button map for each configured input', () => {
|
|
const map = generateButtonMap(testProfile)
|
|
|
|
expect(map.size).toBe(Object.keys(testProfile.colors).length)
|
|
|
|
const lpEntry = map.get('LP')
|
|
expect(lpEntry).toBeTruthy()
|
|
expect(lpEntry?.alt).toBe('LP')
|
|
expect(lpEntry?.class).toBe('buttonIcon')
|
|
})
|
|
|
|
it('creates canonical motion lookup for parser tokens', () => {
|
|
const map = canonicalMotionMap()
|
|
|
|
expect(map.get('qcf')?.alt).toBe('QCF')
|
|
expect(map.get('qcb')?.alt).toBe('QCB')
|
|
expect(map.get('dp')?.alt).toBe('DP')
|
|
expect(map.get('neutral')?.alt).toBe('')
|
|
})
|
|
|
|
it('covers all canonical schema values with motion configs', () => {
|
|
expect(getMissingCanonicalMotionConfigs()).toEqual([])
|
|
})
|
|
})
|