Open Bug 2087288 Opened 20 days ago

Use all-caps GIVEN/WHEN/THEN in MetricsUtilsTestRobolectric test names

Categories

(Firefox for Android :: General, task)

task

Tracking

()

People

(Reporter: skhan, Unassigned, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [lang=kotlin])

Filing as a good first bug to learn workflows.

All 18 test names in MetricsUtilsTestRobolectric.kt spell the Given/When/Then parts in lower case, which makes the three parts of each name hard to pick out when scanning the file. Much of the tree writes them in capitals instead. The task is to rewrite the names in that file so GIVEN, WHEN and THEN are capitalised, changing nothing else.

For example:

fun `given a search engine with a telemetry suffix, when recording a search then the telemetry id is the engine id with the suffix`()

would become:

fun `GIVEN a search engine with a telemetry suffix WHEN recording a search THEN the telemetry id is the engine id with the suffix`()

Only the names change. Do not change what any test does, and do not rename the file or the class. A few names do not have all three parts, and those keep whatever parts they have.

Link to the code:
https://searchfox.org/firefox-main/rev/b0625683b9b8cd108f6b3fa9eedbcd4aa0066d6e/mobile/android/fenix/app/src/test/java/org/mozilla/fenix/components/metrics/MetricsUtilsTestRobolectric.kt#29

To verify the fix, the same 18 tests should still be there and still pass:

./mach gradle -p mobile/android/fenix app:testDebugUnitTest --tests 'MetricsUtilsTestRobolectric'

This was asked for as a follow-up while reviewing D337309, so the file reads consistently with the convention used elsewhere in the tree.

Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html

Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.

You need to log in before you can comment on or make changes to this bug.