aboutsummaryrefslogtreecommitdiff
path: root/tests/test-pearl-query.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-pearl-query.el')
-rw-r--r--tests/test-pearl-query.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/test-pearl-query.el b/tests/test-pearl-query.el
index b5d2816..697dd9a 100644
--- a/tests/test-pearl-query.el
+++ b/tests/test-pearl-query.el
@@ -144,8 +144,16 @@
;;; the bulk query fetches comments so the list can render them
(ert-deftest test-pearl-issues-query-requests-comments ()
- "The bulk issues query selects comments, so a populated list shows them."
- (should (string-match-p "comments[[:space:]]*{[[:space:]]*nodes" pearl--issues-query)))
+ "The bulk issues query selects capped, newest-first comments by default."
+ (let ((pearl-fetch-comments-in-list t)
+ (pearl-list-comments-count-cap 25))
+ (should (string-match-p "comments(first: 26, orderBy: createdAt)[[:space:]]*{[[:space:]]*nodes"
+ (pearl--issues-query)))))
+
+(ert-deftest test-pearl-issues-query-omits-comments-when-disabled ()
+ "With list comments disabled, the bulk query carries no comments selection."
+ (let ((pearl-fetch-comments-in-list nil))
+ (should-not (string-match-p "comments" (pearl--issues-query)))))
;;; malformed remote page shapes