Bug 1957974 - Add available locales record and perplexity to search-config-v2. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D244851
This commit is contained in:
mcheang
2025-05-08 19:24:10 +00:00
committed by mcheang@mozilla.com
parent 46b15fad21
commit 80382da17a

View File

@@ -174,6 +174,29 @@ add_task(async function test_search_config_valid_partner_codes() {
}
});
add_task(
async function test_search_config_all_locales_are_in_available_locales() {
let selector = new SearchEngineSelector(() => {});
let config = await selector.getEngineConfiguration();
let availableLocales = new Set(
config.find(entry => entry.recordType == "availableLocales").locales
);
let localesInConfig = SearchTestUtils.extractAvailableLocales(config);
Assert.deepEqual(
Array.from(localesInConfig.difference(availableLocales)),
[],
"Available locales should have all the locales listed in other parts of the configuration"
);
Assert.deepEqual(
Array.from(availableLocales.difference(localesInConfig)),
[],
"Available locales should not have any locales not listed in other parts of the configuration"
);
}
);
add_task(async function test_search_config_override_validates_to_schema() {
let selector = new SearchEngineSelector(() => {});