diff --git a/toolkit/components/search/schema/search-config-v2-schema.json b/toolkit/components/search/schema/search-config-v2-schema.json index 8b941e59381a..05515a8ed26d 100644 --- a/toolkit/components/search/schema/search-config-v2-schema.json +++ b/toolkit/components/search/schema/search-config-v2-schema.json @@ -345,7 +345,7 @@ }, "telemetrySuffix": { "title": "Telemetry Suffix", - "description": "Suffix that is appended to the search engine identifier following a dash, i.e. `-`. There should always be a suffix supplied if the partner code is different.", + "description": "Suffix that is appended to the search engine identifier following a dash, i.e. `-`. There should always be a suffix supplied if the partner code is different for a reason other than being on a different platform.", "type": "string", "pattern": "^[a-zA-Z0-9-]*$" }, @@ -384,10 +384,7 @@ } } }, - "required": ["environment"], - "dependencies": { - "partnerCode": ["telemetrySuffix"] - } + "required": ["environment"] } } }, diff --git a/toolkit/components/search/tests/xpcshell/searchconfigs/test_searchconfig_validates.js b/toolkit/components/search/tests/xpcshell/searchconfigs/test_searchconfig_validates.js index 86686b62f7fe..f727d6071993 100644 --- a/toolkit/components/search/tests/xpcshell/searchconfigs/test_searchconfig_validates.js +++ b/toolkit/components/search/tests/xpcshell/searchconfigs/test_searchconfig_validates.js @@ -170,6 +170,32 @@ add_task( } ); +add_task( + { skip_if: () => !SearchUtils.newSearchConfigEnabled }, + async function test_search_config_valid_partner_codes() { + delete SearchUtils.newSearchConfigEnabled; + SearchUtils.newSearchConfigEnabled = true; + + let selector = new SearchEngineSelector(() => {}); + + for (let entry of await selector.getEngineConfiguration()) { + if (entry.recordType == "engine") { + for (let variant of entry.variants) { + if ( + "partnerCode" in variant && + "distributions" in variant.environment + ) { + Assert.ok( + variant.telemetrySuffix, + `${entry.identifier} should have a telemetrySuffix when a distribution is specified with a partnerCode.` + ); + } + } + } + } + } +); + add_task( { skip_if: () => !SearchUtils.newSearchConfigEnabled }, async function test_search_config_override_validates_to_schema() {