File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
src/RichTextEditor/utils/keyDownTypeFor Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ import applyFormatMarkdown from "./applyFormatMarkdown"
2+ import keyCodeFor from "lib/Client/keyCodeFor"
3+
4+ test ( "em(...)" , ( ) => {
5+ expect ( applyFormatMarkdown . em ( {
6+ shiftKey : true ,
7+ ctrlKey : false ,
8+ metaKey : false ,
9+ keyCode : keyCodeFor ( "_" ) ,
10+ } ) ) . toBeTruthy ( )
11+ } )
12+
13+ test ( "strong(...)" , ( ) => {
14+ expect ( applyFormatMarkdown . strong ( {
15+ shiftKey : true ,
16+ ctrlKey : false ,
17+ metaKey : false ,
18+ keyCode : keyCodeFor ( "*" ) ,
19+ } ) ) . toBeTruthy ( )
20+ } )
21+
22+ test ( "code(...)" , ( ) => {
23+ expect ( applyFormatMarkdown . code ( {
24+ shiftKey : false ,
25+ ctrlKey : false ,
26+ metaKey : false ,
27+ keyCode : keyCodeFor ( "`" ) ,
28+ } ) ) . toBeTruthy ( )
29+ } )
30+
31+ test ( "strike(...)" , ( ) => {
32+ expect ( applyFormatMarkdown . strike ( {
33+ shiftKey : true ,
34+ ctrlKey : false ,
35+ metaKey : false ,
36+ keyCode : keyCodeFor ( "~" ) ,
37+ } ) ) . toBeTruthy ( )
38+ } )
39+
40+ test ( "a(...)" , ( ) => {
41+ expect ( applyFormatMarkdown . a ( {
42+ shiftKey : false ,
43+ ctrlKey : false ,
44+ metaKey : false ,
45+ keyCode : keyCodeFor ( "[" ) ,
46+ } ) ) . toBeTruthy ( )
47+ } )
48+
49+ test ( "a(...)" , ( ) => {
50+ expect ( applyFormatMarkdown . a ( {
51+ shiftKey : false ,
52+ ctrlKey : false ,
53+ metaKey : false ,
54+ keyCode : keyCodeFor ( "]" ) ,
55+ } ) ) . toBeTruthy ( )
56+ } )
You can’t perform that action at this time.
0 commit comments