mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1767266 - Make ExtensionDoorhanger.schema.json more lenient r=Mardak
Differential Revision: https://phabricator.services.mozilla.com/D145241
This commit is contained in:
parent
7b78f5e339
commit
217dd347c1
@ -387,7 +387,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"additionalProperties": true,
|
||||
"required": [
|
||||
"layout",
|
||||
"category",
|
||||
@ -427,5 +427,6 @@
|
||||
"required": ["id"]
|
||||
}
|
||||
},
|
||||
"additionalProperties": true,
|
||||
"required": ["id", "groups", "content", "targeting", "template", "trigger"]
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ const { JsonSchema } = ChromeUtils.import(
|
||||
|
||||
Cu.importGlobalProperties(["fetch"]);
|
||||
|
||||
let CFR_SCHEMA;
|
||||
let UPDATE_ACTION_SCHEMA;
|
||||
let WHATS_NEW_SCHEMA;
|
||||
let SPOTLIGHT_SCHEMA;
|
||||
@ -20,6 +21,9 @@ add_setup(async function setup() {
|
||||
return fetch(uri, { credentials: "omit" }).then(rsp => rsp.json());
|
||||
}
|
||||
|
||||
CFR_SCHEMA = await fetchSchema(
|
||||
"resource://activity-stream/schemas/CFR/ExtensionDoorhanger.schema.json"
|
||||
);
|
||||
UPDATE_ACTION_SCHEMA = await fetchSchema(
|
||||
"resource://activity-stream/schemas/OnboardingMessage/UpdateAction.schema.json"
|
||||
);
|
||||
@ -103,3 +107,35 @@ add_task(async function test_PanelTestProvider() {
|
||||
"There is one pb_newtab message"
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_SpotlightAsCFR() {
|
||||
let message = await PanelTestProvider.getMessages().then(msgs =>
|
||||
msgs.find(msg => msg.id === "TCP_SPOTLIGHT_MESSAGE_95")
|
||||
);
|
||||
|
||||
message = {
|
||||
...message,
|
||||
content: {
|
||||
...message.content,
|
||||
category: "",
|
||||
layout: "icon_and_message",
|
||||
bucket_id: "",
|
||||
notification_text: "",
|
||||
heading_text: "",
|
||||
text: "",
|
||||
buttons: {},
|
||||
},
|
||||
};
|
||||
|
||||
assertSchema(
|
||||
message,
|
||||
CFR_SCHEMA,
|
||||
"Munged spotlight message validates with CFR ExtensionDoorhanger schema"
|
||||
);
|
||||
|
||||
assertSchema(
|
||||
message,
|
||||
SPOTLIGHT_SCHEMA,
|
||||
"Munged Spotlight message validates with Spotlight schema"
|
||||
);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user