Skip to content

Commit

Permalink
test: add mapPlatformKeys tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ManpreetSL committed Jul 14, 2023
1 parent 533707a commit 77e2696
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/frontend/src/lib/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,19 @@ describe( 'utils', () => {
expect( mapPlatformKey( 'ctrl+D' ) ).toBe( 'ctrl+D' )
} )
} )

describe( 'mapPlatformKeys', () => {
it( 'should not fail if passed an empty object', () => {
const result = mapPlatformKeys( {} )

expect( result ).toEqual( {} )
} )

it( 'should return the keyMap argument as-is if not on Mac', () => {
isMacMockGetter.mockReturnValue( false )
mapPlatformKeys( {} )
} )

it.todo( 'should transform ctrl to cmd in key bindings if on Mac' )
} )
} )

0 comments on commit 77e2696

Please sign in to comment.