Skip to content

Commit

Permalink
replace rest of occurences of respecIsReady
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Aug 25, 2020
1 parent 9c7194e commit 15c6b96
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tests/spec/SpecHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions tests/spec/core/caniuse-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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();
Expand All @@ -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");
Expand All @@ -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");

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/core/seo-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]");
Expand All @@ -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]")
Expand Down
2 changes: 1 addition & 1 deletion tools/respecDocWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down

0 comments on commit 15c6b96

Please sign in to comment.