Bug 1685180 - Ensure tests all properly set fluent args; r=nordzilla,settings-reviewers,Gijs

Either provide the dynamic data correctly in tests, or provide empty
strings when it doesn't exist.

Differential Revision: https://phabricator.services.mozilla.com/D162336
This commit is contained in:
Greg Tatum 2022-12-01 21:40:57 +00:00
parent d3921e547e
commit 0cb480a897
2 changed files with 8 additions and 3 deletions

View File

@ -263,6 +263,10 @@ function setupSyncFxAMocks({ fxaDevices = null, state, syncEnabled = true }) {
return {
status: gUIStateStatus,
syncEnabled,
email:
gUIStateStatus === UIState.STATUS_NOT_CONFIGURED
? undefined
: "email@example.com",
};
});
@ -288,6 +292,7 @@ function setupRecentDeviceListMocks() {
sandbox.stub(UIState, "get").returns({
status: UIState.STATUS_SIGNED_IN,
syncEnabled: true,
email: "email@example.com",
});
return sandbox;

View File

@ -67,7 +67,7 @@ RPMSendQuery("RequestPlugins", {}).then(aPlugins => {
file.setAttribute("class", "label");
fileDd.appendChild(file);
document.l10n.setAttributes(fileDd, "file-dd", {
pluginLibraries: plugin.pluginLibraries[0],
pluginLibraries: plugin.pluginLibraries[0] ?? "",
});
dl.appendChild(fileDd);
@ -78,7 +78,7 @@ RPMSendQuery("RequestPlugins", {}).then(aPlugins => {
path.setAttribute("class", "label");
pathDd.appendChild(path);
document.l10n.setAttributes(pathDd, "path-dd", {
pluginFullPath: plugin.pluginFullpath[0],
pluginFullPath: plugin.pluginFullpath[0] ?? "",
});
dl.appendChild(pathDd);
@ -89,7 +89,7 @@ RPMSendQuery("RequestPlugins", {}).then(aPlugins => {
version.setAttribute("class", "label");
versionDd.appendChild(version);
document.l10n.setAttributes(versionDd, "version-dd", {
version: plugin.version,
version: plugin.version ?? "",
});
dl.appendChild(versionDd);