diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /browser/components/newtab/test/xpcshell/test_TelemetryFeed.js | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-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.js | 32 |
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( |