File tree Expand file tree Collapse file tree
RichTextEditor/utils/keyDownTypeFor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import history from "./history"
22import keyCodeFor from "lib/Client/keyCodeFor"
33
4- // Mocks a non-macOS user agent.
5- function mockNonMacOS ( ) {
6- Object . defineProperty ( window . navigator , "userAgent" , {
7- value : "..." ,
8- configurable : true ,
9- } )
10- }
11-
12- // Mocks a macOS user agent.
13- function mockMacOS ( ) {
14- Object . defineProperty ( window . navigator , "userAgent" , {
15- value : "... Mac OS X ..." ,
16- configurable : true ,
17- } )
18- }
4+ import { // Unsorted
5+ mockNonMacOS ,
6+ mockMacOS ,
7+ } from "lib/Client/mockUserAgent"
198
209test ( "undo(...); non-macOS" , ( ) => {
2110 mockNonMacOS ( )
Original file line number Diff line number Diff line change 11import isCtrlOrMetaKey from "./index"
22
3- // Mocks a non-macOS user agent.
4- function mockNonMacOS ( ) {
5- Object . defineProperty ( window . navigator , "userAgent" , {
6- value : "..." ,
7- configurable : true ,
8- } )
9- }
10-
11- // Mocks a macOS user agent.
12- function mockMacOS ( ) {
13- Object . defineProperty ( window . navigator , "userAgent" , {
14- value : "... Mac OS X ..." ,
15- configurable : true ,
16- } )
17- }
3+ import { // Unsorted
4+ mockNonMacOS ,
5+ mockMacOS ,
6+ } from "lib/Client/mockUserAgent"
187
198test ( "non-macOS" , ( ) => {
209 mockNonMacOS ( )
Original file line number Diff line number Diff line change 1- // Mocks a non-macOS user agent.
1+ // Mocks a non-macOS user agent; for testing purposes .
22export function mockNonMacOS ( ) {
33 Object . defineProperty ( window . navigator , "userAgent" , {
44 value : "..." ,
55 configurable : true ,
66 } )
77}
88
9- // Mocks a macOS user agent.
9+ // Mocks a macOS user agent; for testing purposes .
1010export function mockMacOS ( ) {
1111 Object . defineProperty ( window . navigator , "userAgent" , {
1212 value : "... Mac OS X ..." ,
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ function testUserAgent(substr) {
55 return navigator . userAgent . indexOf ( substr ) >= 0
66}
77
8+ // TODO: Add testedAppleDevice?
9+ // TODO: Add testedAndroidDevice?
810const userAgent = {
911 // https://apple.com
1012 isAAPL : testUserAgent ( "Mac OS X" ) ,
You can’t perform that action at this time.
0 commit comments