@ryusei/code
Version:
<div align="center"> <a href="https://code.ryuseijs.com"> <img alt="RyuseiCode" src="https://code.ryuseijs.com/images/svg/logo.svg" width="70"> </a>
17 lines (13 loc) • 523 B
text/typescript
import { NORMALIZATION_MAP } from '../../../constants/keys';
import { normalizeKey } from './normalizeKey';
describe( 'normalizeKey', () => {
test( 'can normalize key values.', () => {
Object.keys( NORMALIZATION_MAP ).forEach( key => {
expect( normalizeKey( key ) ).toBe( NORMALIZATION_MAP[ key ] );
} );
} );
test( 'should return the key itself if it is not in the key list.', () => {
expect( normalizeKey( 'a' ) ).toBe( 'a' );
expect( normalizeKey( 'Shift' ) ).toBe( 'Shift' );
} );
} );