1
0
Fork 0

Add check that kagi-fastgpt-prompt is called non-interactively

This commit is contained in:
Bram Schoenmakers 2024-03-31 17:49:38 +02:00
parent b0e33aa8e6
commit 3f60094815
Signed by: bram
GPG key ID: 0CCD19DFDC63258F

View file

@ -247,10 +247,11 @@ https://www.example.com"
(describe "kagi-proofread"
(before-each
(spy-on #'kagi-fastgpt-prompt))
(it "calls kagi-fastgpt-prompt"
(it "calls kagi-fastgpt-prompt non-interactively"
(kagi-proofread "foo")
(expect #'kagi-fastgpt-prompt :to-have-been-called)
(kagi-test--expect-arg #'kagi-fastgpt-prompt 0 :to-match "foo"))
(kagi-test--expect-arg #'kagi-fastgpt-prompt 0 :to-match "foo")
(kagi-test--expect-arg #'kagi-fastgpt-prompt 2 :to-equal nil))
(it "passes the region text to kagi-fastgpt-prompt, if active"
(spy-on #'use-region-p :and-return-value t)
(spy-on #'buffer-substring-no-properties :and-return-value "region text")