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:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /browser/components/newtab/test/xpcshell/test_TelemetryFeed.js
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 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(