Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(override-configuration-spec): merge tests #1311

Merged
merged 1 commit into from Jul 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 5 additions & 12 deletions tests/spec/core/override-configuration-spec.js
Expand Up @@ -5,11 +5,15 @@ describe("Core — Override Configuration", () => {
done();
});
const simpleURL = new URL("./spec/core/simple.html", document.location);
it("overrides a simple string setting", done => {
it("overrides a simple string setting and decodes URL key/values strings correctly", done => {
const url = new URL(simpleURL.href);
url.searchParams.set("specStatus", "RSCND");
url.searchParams.set("previousMaturity", "REC");
url.searchParams.set("previousPublishDate", "1994-03-01");
url.searchParams.set(
"additionalCopyrightHolders",
"Internet Engineering Task Force"
);
const test = doc => {
const { respecConfig: conf } = doc.defaultView;
const { textContent } = doc.querySelector(".head h2");
Expand All @@ -18,17 +22,6 @@ describe("Core — Override Configuration", () => {
expect(month).toEqual(2);
const { previousMaturity } = conf;
expect(previousMaturity).toEqual("REC");
done();
};
makeRSDoc(makeStandardOps(), test, url);
});
it("decodes URL key/values strings correctly", done => {
const url = new URL(simpleURL.href);
url.searchParams.set(
"additionalCopyrightHolders",
"Internet Engineering Task Force"
);
const test = doc => {
const copyrightText = doc.querySelector(".copyright").textContent;
expect(copyrightText).toMatch(/Internet Engineering Task Force/);
done();
Expand Down