summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/test/xpcshell/test_TelemetryFeed.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /browser/components/newtab/test/xpcshell/test_TelemetryFeed.js
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/newtab/test/xpcshell/test_TelemetryFeed.js')
-rw-r--r--browser/components/newtab/test/xpcshell/test_TelemetryFeed.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/browser/components/newtab/test/xpcshell/test_TelemetryFeed.js b/browser/components/newtab/test/xpcshell/test_TelemetryFeed.js
index b54d6094ad..59d82f5583 100644
--- a/browser/components/newtab/test/xpcshell/test_TelemetryFeed.js
+++ b/browser/components/newtab/test/xpcshell/test_TelemetryFeed.js
@@ -2860,6 +2860,38 @@ add_task(async function test_handleDiscoveryStreamUserEvent_popular_click() {
sandbox.restore();
});
+add_task(async function test_handleDiscoveryStreamUserEvent_tooltip_click() {
+ info(
+ "TelemetryFeed.handleDiscoveryStreamUserEvent instruments a " +
+ "tooltip click"
+ );
+
+ let sandbox = sinon.createSandbox();
+ let instance = new TelemetryFeed();
+ Services.fog.testResetFOG();
+ const feature = "SPONSORED_CONTENT_INFO";
+ let action = ac.DiscoveryStreamUserEvent({
+ event: "CLICK",
+ source: "FEATURE_HIGHLIGHT",
+ value: {
+ feature,
+ },
+ });
+
+ const SESSION_ID = "decafc0ffee";
+ sandbox.stub(instance.sessions, "get").returns({ session_id: SESSION_ID });
+
+ instance.handleDiscoveryStreamUserEvent(action);
+ let tooltipClicks = Glean.newtab.tooltipClick.testGetValue();
+ Assert.equal(tooltipClicks.length, 1, "Recorded 1 click");
+ Assert.deepEqual(tooltipClicks[0].extra, {
+ newtab_visit_id: SESSION_ID,
+ feature,
+ });
+
+ sandbox.restore();
+});
+
add_task(
async function test_handleDiscoveryStreamUserEvent_organic_top_stories_click() {
info(