From 70e177f23bcb3c6e24e139c2fb8a5e62dbc76d4b Mon Sep 17 00:00:00 2001 From: Marcos Caceres Date: Wed, 19 Jul 2017 16:41:49 +1000 Subject: [PATCH] test(w3c/headers-spec): normalize whispace in test --- tests/spec/w3c/headers-spec.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/spec/w3c/headers-spec.js b/tests/spec/w3c/headers-spec.js index 1b72747279..2d5d2ff970 100644 --- a/tests/spec/w3c/headers-spec.js +++ b/tests/spec/w3c/headers-spec.js @@ -910,9 +910,15 @@ describe("W3C — Headers", function() { }; Object.assign(ops.config, newProps); makeRSDoc(ops, doc => { - const aElem = doc.querySelector(`a[href^="http://www.w3.org/2003/03/Translations/"]`); + const aElem = doc.querySelector( + `a[href^="http://www.w3.org/2003/03/Translations/"]` + ); expect(aElem.href.endsWith("PASS")).toBeTruthy(); - expect(aElem.parentElement.textContent.trim()).toEqual("See also translations."); + const textContent = aElem.parentElement.textContent + .trim() + .replace("\n", "") + .replace(/\s+/g, " "); + expect().toEqual("See also translations."); }).then(done); }); it("doesn't include a translation link when it's not REC", done => { @@ -923,7 +929,9 @@ describe("W3C — Headers", function() { }; Object.assign(ops.config, newProps); makeRSDoc(ops, doc => { - const aElem = doc.querySelector(`a[href^="http://www.w3.org/2003/03/Translations/"]`); + const aElem = doc.querySelector( + `a[href^="http://www.w3.org/2003/03/Translations/"]` + ); expect(aElem).toEqual(null); }).then(done); });