Skip to content

Commit

Permalink
switch to true|false for protectionsState param (#3838)
Browse files Browse the repository at this point in the history
Task/Issue URL:  https://app.asana.com/0/0/1205915950517978/f

### Description

Switching to true|false instead of 1|0 for cross-platform consistency.
See the parent task
https://app.asana.com/0/1201141132935289/1205644489547731

### Steps to test this PR

- [x] Submit the breakage form with protections on
- [x] Verify that the breakage form pixel param `protectionsState` is
the string `true`
- [x] Submit the breakage form with protections off
- [x] Verify that the breakage form pixel param `protectionsState` is
the string `false`
  • Loading branch information
shakyShane authored Nov 9, 2023
1 parent 5ac9d51 commit 5939b1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class BrokenSiteSubmitter @Inject constructor(
REMOTE_CONFIG_ETAG to privacyConfig.privacyConfigData()?.eTag.orEmpty(),
ERROR_CODES_KEY to brokenSite.errorCodes,
HTTP_ERROR_CODES_KEY to brokenSite.httpErrorCodes,
PROTECTIONS_STATE to protectionsState.toBinaryString(),
PROTECTIONS_STATE to protectionsState.toString(),
)

val lastSentDay = brokenSiteLastSentReport.getLastSentDay(domain.orEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class BrokenSiteSubmitterTest {
verify(mockPixel).fire(eq(BROKEN_SITE_REPORT.pixelName), paramsCaptor.capture(), encodedParamsCaptor.capture())
val params = paramsCaptor.firstValue

assertEquals("0", params["protectionsState"])
assertEquals("false", params["protectionsState"])
}

@Test
Expand All @@ -133,7 +133,7 @@ class BrokenSiteSubmitterTest {
verify(mockPixel).fire(eq(BROKEN_SITE_REPORT.pixelName), paramsCaptor.capture(), encodedParamsCaptor.capture())
val params = paramsCaptor.firstValue

assertEquals("0", params["protectionsState"])
assertEquals("false", params["protectionsState"])
}

@Test
Expand All @@ -150,7 +150,7 @@ class BrokenSiteSubmitterTest {
verify(mockPixel).fire(eq(BROKEN_SITE_REPORT.pixelName), paramsCaptor.capture(), encodedParamsCaptor.capture())
val params = paramsCaptor.firstValue

assertEquals("0", params["protectionsState"])
assertEquals("false", params["protectionsState"])
}

@Test
Expand All @@ -169,7 +169,7 @@ class BrokenSiteSubmitterTest {
verify(mockPixel).fire(eq(BROKEN_SITE_REPORT.pixelName), paramsCaptor.capture(), encodedParamsCaptor.capture())
val params = paramsCaptor.firstValue

assertEquals("0", params["protectionsState"])
assertEquals("false", params["protectionsState"])
}

@Test
Expand All @@ -186,7 +186,7 @@ class BrokenSiteSubmitterTest {
verify(mockPixel).fire(eq(BROKEN_SITE_REPORT.pixelName), paramsCaptor.capture(), encodedParamsCaptor.capture())
val params = paramsCaptor.firstValue

assertEquals("1", params["protectionsState"])
assertEquals("true", params["protectionsState"])
}

@Test
Expand Down

0 comments on commit 5939b1c

Please sign in to comment.