From 15c6b96458197859f90f07d18956bc40ef7b7739 Mon Sep 17 00:00:00 2001 From: Sid Vishnoi Date: Tue, 25 Aug 2020 17:02:58 +0530 Subject: [PATCH] replace rest of occurences of respecIsReady --- tests/spec/SpecHelper.js | 4 ++-- tests/spec/core/caniuse-spec.js | 12 ++++++------ tests/spec/core/seo-spec.js | 4 ++-- tools/respecDocWriter.js | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/spec/SpecHelper.js b/tests/spec/SpecHelper.js index f0edfe1385..850a24fcab 100644 --- a/tests/spec/SpecHelper.js +++ b/tests/spec/SpecHelper.js @@ -17,8 +17,8 @@ export function makeRSDoc(opts, src, style = "") { if (src) { decorateDocument(doc, opts); } - if (doc.respecIsReady) { - await doc.respecIsReady; + if (doc.respec) { + await doc.respec.ready; resolve(doc); } window.addEventListener("message", function msgHandler(ev) { diff --git a/tests/spec/core/caniuse-spec.js b/tests/spec/core/caniuse-spec.js index 64e7ca756c..8f43e6fda0 100644 --- a/tests/spec/core/caniuse-spec.js +++ b/tests/spec/core/caniuse-spec.js @@ -20,7 +20,7 @@ describe("Core — Can I Use", () => { }, }); const doc = await makeRSDoc(ops); - await doc.respecIsReady; + await doc.respec.ready; const { caniuse } = doc.defaultView.respecConfig; expect(caniuse.feature).toBe("FEATURE"); @@ -38,7 +38,7 @@ describe("Core — Can I Use", () => { }, }); const doc = await makeRSDoc(ops); - await doc.respecIsReady; + await doc.respec.ready; const { caniuse } = doc.defaultView.respecConfig; expect(caniuse.feature).toBe("FEATURE"); @@ -49,7 +49,7 @@ describe("Core — Can I Use", () => { it("does nothing if caniuse is not enabled", async () => { const ops = makeStandardOps(); const doc = await makeRSDoc(ops); - await doc.respecIsReady; + await doc.respec.ready; const { caniuse } = doc.defaultView.respecConfig; expect(caniuse).toBeFalsy(); @@ -65,7 +65,7 @@ describe("Core — Can I Use", () => { }, }); const doc = await makeRSDoc(ops); - await doc.respecIsReady; + await doc.respec.ready; const link = doc.querySelector(".caniuse-stats a"); expect(link.textContent).toBe("caniuse.com"); @@ -82,7 +82,7 @@ describe("Core — Can I Use", () => { }, }); const doc = await makeRSDoc(ops); - await doc.respecIsReady; + await doc.respec.ready; const stats = doc.querySelector(".caniuse-stats"); @@ -125,7 +125,7 @@ describe("Core — Can I Use", () => { apiURL: `${window.location.origin}/tests/data/caniuse/{FEATURE}.json`, }; const doc = await makeRSDoc(opsWithCaniuse); - await doc.respecIsReady; + await doc.respec.ready; const text = doc.getElementById("initialUserConfig").textContent; expect(JSON.parse(text)).toEqual(expectedObj); diff --git a/tests/spec/core/seo-spec.js b/tests/spec/core/seo-spec.js index bf6a244380..d40ceb2892 100644 --- a/tests/spec/core/seo-spec.js +++ b/tests/spec/core/seo-spec.js @@ -16,7 +16,7 @@ describe("Core — Seo", () => { body: makeDefaultBody(), }; const doc = await makeRSDoc(ops); - await doc.respecIsReady; + await doc.respec.ready; await new Promise(resolve => { const check = () => { const hasMetaDesc = doc.querySelectorAll("meta[name=description]"); @@ -37,7 +37,7 @@ describe("Core — Seo", () => { body: makeDefaultBody(), }; const doc = await makeRSDoc(ops); - await doc.respecIsReady; + await doc.respec.ready; await new Promise(resolve => { const check = () => { const hasMetaDesc = doc.querySelectorAll("meta[name=description]") diff --git a/tools/respecDocWriter.js b/tools/respecDocWriter.js index 88a10f9d61..5609d2b805 100644 --- a/tools/respecDocWriter.js +++ b/tools/respecDocWriter.js @@ -191,7 +191,7 @@ async function evaluateHTML(version, timer) { function timeout(promise, ms) { return new Promise((resolve, reject) => { promise.then(resolve, reject); - const msg = `Timeout: document.respecIsReady didn't resolve in ${ms}ms.`; + const msg = `Timeout: document.respec.ready didn't resolve in ${ms}ms.`; setTimeout(() => reject(msg), ms); }); }