test(editor): page-search-hashtag at handle-last-input

pull/7395/head^2
Andelf 2022-11-22 09:01:56 +08:00 committed by Tienson Qin
parent e31cfb1c65
commit 674022d4fb
1 changed files with 21 additions and 1 deletions

View File

@ -96,4 +96,24 @@
(handle-last-input-handler {:value "first \nfoo::bar"
:cursor-pos (dec (count "first "))})
(is (= nil (state/get-editor-action))
"Don't autocomplete properties if typing in a block where properties already exist")))
"Don't autocomplete properties if typing in a block where properties already exist")
(handle-last-input-handler {:value "#"
:cursor-pos 1})
(is (= :page-search-hashtag (state/get-editor-action))
"Page search if only hashtags has been typed")
(handle-last-input-handler {:value "foo bar#"
:cursor-pos 8})
(is (= :page-search-hashtag (state/get-editor-action))
"Page search if hashtags has been typed as EOL")
(handle-last-input-handler {:value "foo #"
:cursor-pos 5})
(is (= :page-search-hashtag (state/get-editor-action))
"Page search if hashtags has been typed after a space")
(handle-last-input-handler {:value "foo#bar"
:cursor-pos 4})
(is (= :page-search-hashtag (state/get-editor-action))
"Page search if hashtags has been typed in the middle of a line")))