For #25401 - Add the PocketIntegration Glean annotation tag to all Pocket telemetry

pull/543/head
Mugurell 2 years ago committed by mergify[bot]
parent d4dd62341a
commit f906dda054

@ -1623,6 +1623,9 @@ customize_home:
notification_emails:
- android-probes@mozilla.com
expires: 105
metadata:
tags:
- PocketIntegration
sponsored_pocket:
type: boolean
description: |
@ -5390,6 +5393,9 @@ pocket:
notification_emails:
- android-probes@mozilla.com
expires: 106
metadata:
tags:
- PocketIntegration
home_recs_story_clicked:
type: event
description: |
@ -5413,6 +5419,9 @@ pocket:
notification_emails:
- android-probes@mozilla.com
expires: 106
metadata:
tags:
- PocketIntegration
home_recs_spoc_clicked:
type: event
description: |
@ -5493,6 +5502,9 @@ pocket:
notification_emails:
- android-probes@mozilla.com
expires: 106
metadata:
tags:
- PocketIntegration
home_recs_discover_clicked:
type: event
description: |
@ -5507,6 +5519,9 @@ pocket:
notification_emails:
- android-probes@mozilla.com
expires: 106
metadata:
tags:
- PocketIntegration
home_recs_learn_more_clicked:
type: event
description: |
@ -5520,6 +5535,9 @@ pocket:
notification_emails:
- android-probes@mozilla.com
expires: 106
metadata:
tags:
- PocketIntegration
first_session:
campaign:

@ -240,10 +240,11 @@ class SessionControlInteractorTest {
@Test
fun `GIVEN a PocketStoriesInteractor WHEN a story is shown THEN handle it in a PocketStoriesController`() {
val shownStory: PocketStory = mockk()
val storyGridLocation = 1 to 2
interactor.onStoryShown(shownStory)
interactor.onStoryShown(shownStory, storyGridLocation)
verify { pocketStoriesController.handleStoryShown(shownStory) }
verify { pocketStoriesController.handleStoryShown(shownStory, storyGridLocation) }
}
@Test

@ -145,16 +145,30 @@ class DefaultPocketStoriesControllerTest {
}
@Test
fun `WHEN a new story is shown THEN update the State`() {
fun `WHEN a new recommended story is shown THEN update the State`() {
val store = spyk(AppStore())
val controller = DefaultPocketStoriesController(mockk(), store, mockk())
val storyShown: PocketStory = mockk()
val storyShown: PocketRecommendedStory = mockk()
val storyGridLocation = 1 to 2
controller.handleStoryShown(storyShown)
controller.handleStoryShown(storyShown, storyGridLocation)
verify { store.dispatch(AppAction.PocketStoriesShown(listOf(storyShown))) }
}
@Test
fun `WHEN a new sponsored story is shown THEN update the State and record telemetry`() {
val store = spyk(AppStore())
val controller = DefaultPocketStoriesController(mockk(), store, mockk())
val storyShown: PocketSponsoredStory = mockk(relaxed = true)
val storyGridLocation = 1 to 2
controller.handleStoryShown(storyShown, storyGridLocation)
verify { store.dispatch(AppAction.PocketStoriesShown(listOf(storyShown))) }
assertNotNull(Pocket.homeRecsSpocShown.testGetValue())
}
@Test
fun `WHEN new stories are shown THEN update the State and record telemetry`() {
val store = spyk(AppStore())
@ -199,7 +213,7 @@ class DefaultPocketStoriesControllerTest {
}
@Test
fun `WHEN a sponsored story is clicked THEN open that story's url using HomeActivity and don't record telemetry`() {
fun `WHEN a sponsored story is clicked THEN open that story's url using HomeActivity and record telemetry`() {
val story = PocketSponsoredStory(
id = 7,
title = "",
@ -208,11 +222,11 @@ class DefaultPocketStoriesControllerTest {
sponsor = "",
shim = mockk(),
priority = 3,
caps = mockk(),
caps = mockk(relaxed = true),
)
val homeActivity: HomeActivity = mockk(relaxed = true)
val controller = DefaultPocketStoriesController(homeActivity, mockk(), mockk(relaxed = true))
assertNull(Pocket.homeRecsStoryClicked.testGetValue())
assertNull(Pocket.homeRecsSpocClicked.testGetValue())
controller.handleStoryClicked(story, 1 to 2)

Loading…
Cancel
Save