Skip to content

Commit

Permalink
fix(push): Add previously removed tests (#2589)
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerjroach authored Oct 6, 2023
1 parent 3e5e869 commit d22b04c
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ class TargetingClientTest {
targetingClient = constructTargetingClient()
}

@Test
fun testCurrentEndpoint() {
targetingClient.addAttribute("attribute", listOf("a", "b", "c"))
targetingClient.addMetric("metric", 2.0)
val endpoint = targetingClient.currentEndpoint()
assertEquals(endpoint.getAttribute("attribute"), listOf("a", "b", "c"))
assertEquals(endpoint.getMetric("metric"), 2.0)
}

@Test
fun testUpdateEndpointProfile() = runTest {
setup()
Expand All @@ -56,6 +65,9 @@ class TargetingClientTest {
val expectedToken = "token123"
every { store.get(TargetingClient.AWS_PINPOINT_PUSHNOTIFICATIONS_DEVICE_TOKEN_KEY) } returns expectedToken

targetingClient.addAttribute("attribute", listOf("a1", "a2"))
targetingClient.addMetric("metric", 1.0)

val updateEndpointResponse = UpdateEndpointResponse.invoke {}
coEvery { pinpointClient.updateEndpoint(ofType(UpdateEndpointRequest::class)) }.returns(updateEndpointResponse)
targetingClient.updateEndpointProfile()
Expand Down

0 comments on commit d22b04c

Please sign in to comment.