Skip to content

Commit

Permalink
tests/offline/mode/reduce-tracking: Add redirection test.
Browse files Browse the repository at this point in the history
See #3402.
  • Loading branch information
shamazmazum authored and aadcg committed May 31, 2024
1 parent 8a75497 commit 777fd77
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/offline/mode/reduce-tracking.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
(in-package :nyxt/tests)

(define-test toggle-reduce-tracking-mode ()
(let ((buffer (make-instance 'network-and-modable-buffer)))
(let ((buffer (make-instance 'network-and-modable-buffer))
(url-pre (quri:uri "https://example.com/query?foo=bar&twclid=1&redirect=https://example.org/foo&s_cid=123"))
(url-post (quri:uri "https://example.com/query?foo=bar&redirect=https://example.org/foo")))
(with-current-buffer buffer
(assert-true (enable-modes* 'nyxt/mode/reduce-tracking:reduce-tracking-mode
buffer))
(assert-equality #'quri:uri=
url-post
(url (nhooks:run-hook (request-resource-hook buffer)
(make-instance 'request-data
:url url-pre))))
(assert-true (disable-modes* 'nyxt/mode/reduce-tracking:reduce-tracking-mode
buffer)))))

0 comments on commit 777fd77

Please sign in to comment.