-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(NavigationSearch): swaps Ctrl for Cmd on Macs
- Loading branch information
Showing
5 changed files
with
100 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,53 @@ | ||
import { getInitials } from './utils' | ||
|
||
describe('Testing getInitials', () => { | ||
it.each([ | ||
['Ren & Stimpy', 'RS'], | ||
['Ren & Stimpy-Wein', 'RS'], | ||
['Ren & Stimpy- Wein', 'RW'], | ||
['Ren & Stimpy - Wein', 'RW'], | ||
['R. N. Stimpy', 'RS'], | ||
['1Ren Stimpy', 'RS'], | ||
['Ren', 'R'], | ||
['* Ren & Stimpy', 'RS'], | ||
['234* Ren & Stimpy', 'RS'], | ||
])('it should take "%s" and return "%s"', (words, expectedInitials) => { | ||
// act | ||
const actualInitials = getInitials(words) | ||
|
||
// assert | ||
expect(actualInitials).toBe(expectedInitials) | ||
import { getInitials, getOS } from './utils' | ||
|
||
describe('Testing utils', () => { | ||
describe('Testing getInitials', () => { | ||
it.each([ | ||
['Ren & Stimpy', 'RS'], | ||
['Ren & Stimpy-Wein', 'RS'], | ||
['Ren & Stimpy- Wein', 'RW'], | ||
['Ren & Stimpy - Wein', 'RW'], | ||
['R. N. Stimpy', 'RS'], | ||
['1Ren Stimpy', 'RS'], | ||
['Ren', 'R'], | ||
['* Ren & Stimpy', 'RS'], | ||
['234* Ren & Stimpy', 'RS'], | ||
])('it should take "%s" and return "%s"', (words, expectedInitials) => { | ||
// act | ||
const actualInitials = getInitials(words) | ||
|
||
// assert | ||
expect(actualInitials).toBe(expectedInitials) | ||
}) | ||
}) | ||
|
||
describe('Testing getOS', () => { | ||
it('it should return "Windows" when the user agent includes "Win"', () => { | ||
// arrange | ||
Object.defineProperty(navigator, 'userAgent', { | ||
value: 'Windows', | ||
configurable: true, | ||
}) | ||
|
||
// act | ||
const actualOS = getOS() | ||
|
||
// assert | ||
expect(actualOS).toBe('Windows') | ||
}) | ||
|
||
it('it should return "Macintosh" when the user agent includes "Mac"', () => { | ||
// arrange | ||
Object.defineProperty(navigator, 'userAgent', { | ||
value: 'Macintosh', | ||
configurable: true, | ||
}) | ||
|
||
// act | ||
const actualOS = getOS() | ||
|
||
// assert | ||
expect(actualOS).toBe('Macintosh') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters