Skip to content

Commit

Permalink
Test redirect with REDUCE-TRACKING-MODE
Browse files Browse the repository at this point in the history
  • Loading branch information
shamazmazum committed May 31, 2024
1 parent 45a2496 commit bd1b770
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 bd1b770

Please sign in to comment.