We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f2344d commit 35adec6Copy full SHA for 35adec6
test/codes/clj/docs/frontend/test/infra/analytics_test.cljs
@@ -0,0 +1,13 @@
1
+(ns codes.clj.docs.frontend.test.infra.analytics-test
2
+ (:require [cljs.test :refer-macros [deftest is testing]]
3
+ [clojure.string :as string]
4
+ [codes.clj.docs.frontend.infra.analytics :as analytics]))
5
+
6
+(deftest ga-scripts-test
7
+ (testing "not-blank GA_TAG_ID should return a script containing the tag id"
8
+ (let [ga-tag-id "G-0123456789"
9
+ ga-scripts (analytics/ga-scripts ga-tag-id)]
10
+ (is (instance? js/HTMLScriptElement ga-scripts))
11
+ (is (string/includes? (.-src ga-scripts) ga-tag-id))))
12
+ (testing "blank GA_TAG_ID should not return anything"
13
+ (is (nil? (analytics/ga-scripts "")))))
0 commit comments