Bug 1575078 - Adds spaces between two words separated by commas.r=johannh

Differential Revision: https://phabricator.services.mozilla.com/D42668

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Carolina 2019-08-21 11:37:40 +00:00
parent 8cc2863d6c
commit 54c46b1ae8
2 changed files with 11 additions and 3 deletions

View File

@ -31,7 +31,9 @@ export class InfoItem extends HTMLElement {
this.classList.add(labelText);
let info = this.shadowRoot.querySelector(".info");
info.textContent = this.item.info;
info.textContent = Array.isArray(this.item.info)
? this.item.info.join(", ")
: this.item.info;
// TODO: Use Fluent-friendly condition.
if (this.item.label === "Modulus") {

View File

@ -89,13 +89,19 @@ add_task(async function test() {
.toLowerCase();
let adjustedCertsElemInfo = adjustedCertsElem.sectionItems[i].info;
if (adjustedCertsElemInfo == null) {
adjustedCertsElemInfo = "";
}
if (typeof adjustedCertsElemInfo !== "string") {
if (
typeof adjustedCertsElemInfo !== "string" ||
Array.isArray(adjustedCertsElemInfo)
) {
// there is a case where we have a boolean
adjustedCertsElemInfo = adjustedCertsElemInfo.toString();
adjustedCertsElemInfo = adjustedCertsElemInfo
.toString()
.replace(/,/g, ", ");
}
Assert.ok(