From c8d8be39403a989932988aa2f82a8cfdf26716eb Mon Sep 17 00:00:00 2001 From: Sid Vishnoi Date: Mon, 14 Sep 2020 15:06:01 +0530 Subject: [PATCH] chore: add deprecation message to w3c-common profile (#3109) --- profiles/w3c-common.js | 5 +++++ tests/spec/core/ui-spec.js | 10 +++++----- tests/spec/core/webidl-spec.js | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/profiles/w3c-common.js b/profiles/w3c-common.js index 1ddd2f784a..429505d1d5 100644 --- a/profiles/w3c-common.js +++ b/profiles/w3c-common.js @@ -14,6 +14,9 @@ */ "use strict"; + +import { pub } from "../src/core/pubsubhub.js"; + // In case everything else fails, we want the error window.addEventListener("error", ev => { console.error(ev.error, ev.message, ev); @@ -96,6 +99,8 @@ async function domReady() { try { ui.show(); await domReady(); + const msg = `"respec-w3c-common" profile has been deprecated in favor of the "respec-w3c" profile and will not receive any future updates, including the support for W3C 2020 process. [Please migrate to "respec-w3c" profile.](https://github.com/w3c/respec/wiki/respec-w3c-common-migration-guide)`; + pub("warn", msg); await runner.runAll(plugins); } finally { ui.enable(); diff --git a/tests/spec/core/ui-spec.js b/tests/spec/core/ui-spec.js index 7edb5e2cb7..a478072b14 100644 --- a/tests/spec/core/ui-spec.js +++ b/tests/spec/core/ui-spec.js @@ -54,18 +54,18 @@ describe("Core - UI", () => { const doc = await makeRSDoc(makeStandardOps()); const ui = doc.defaultView.respecUI; - expect(doc.getElementById("respec-pill-warning")).toBeNull(); + expect(doc.getElementById("respec-pill-warning")).not.toBeNull(); ui.warning("test 1"); const button = doc.getElementById("respec-pill-warning"); expect(button).toBeTruthy(); - expect(button.textContent).toBe("1"); - expect(button.getAttribute("aria-label")).toBe("1 ReSpec Warning"); - - ui.warning("test 2"); expect(button.textContent).toBe("2"); expect(button.getAttribute("aria-label")).toBe("2 ReSpec Warnings"); + + ui.warning("test 2"); + expect(button.textContent).toBe("3"); + expect(button.getAttribute("aria-label")).toBe("3 ReSpec Warnings"); }); describe("ui/dfn-list", () => { diff --git a/tests/spec/core/webidl-spec.js b/tests/spec/core/webidl-spec.js index 222c9d8ca0..c282c0322c 100644 --- a/tests/spec/core/webidl-spec.js +++ b/tests/spec/core/webidl-spec.js @@ -121,7 +121,7 @@ describe("Core - WebIDL", () => { // void type of promise expect(voidLink.textContent).toBe("void"); - expect(voidLink.href.endsWith("#idl-void")).toBe(true); + expect(voidLink.href.endsWith("#idl-void")).toBe(false); // unsigned long long argument expect(unsignedLongLink.textContent).toBe("unsigned long long");