mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-08 12:19:05 +02:00
Differential Revision: https://phabricator.services.mozilla.com/D8443 --HG-- rename : browser/components/newtab/content-src/asrouter/templates/NewsletterSnippet/NewsletterSnippet.jsx => browser/components/newtab/content-src/asrouter/templates/SubmitFormSnippet/SubmitFormSnippet.jsx rename : browser/components/newtab/content-src/asrouter/templates/NewsletterSnippet/NewsletterSnippet.schema.json => browser/components/newtab/content-src/asrouter/templates/SubmitFormSnippet/SubmitFormSnippet.schema.json rename : browser/components/newtab/content-src/asrouter/templates/NewsletterSnippet/_NewsletterSnippet.scss => browser/components/newtab/content-src/asrouter/templates/SubmitFormSnippet/_SubmitFormSnippet.scss rename : browser/components/newtab/test/unit/asrouter/templates/NewsletterSnippet.test.jsx => browser/components/newtab/test/unit/asrouter/templates/SubmitFormSnippet.test.jsx extra : moz-landing-system : lando
38 lines
1.8 KiB
JavaScript
38 lines
1.8 KiB
JavaScript
export const CHILD_TO_PARENT_MESSAGE_NAME = "ASRouter:child-to-parent";
|
|
export const PARENT_TO_CHILD_MESSAGE_NAME = "ASRouter:parent-to-child";
|
|
|
|
export const FAKE_LOCAL_MESSAGES = [
|
|
{id: "foo", template: "simple_snippet", content: {title: "Foo", body: "Foo123"}},
|
|
{id: "foo1", template: "simple_snippet", bundled: 2, order: 1, content: {title: "Foo1", body: "Foo123-1"}},
|
|
{id: "foo2", template: "simple_snippet", bundled: 2, order: 2, content: {title: "Foo2", body: "Foo123-2"}},
|
|
{id: "bar", template: "fancy_template", content: {title: "Foo", body: "Foo123"}},
|
|
{id: "baz", content: {title: "Foo", body: "Foo123"}},
|
|
{id: "newsletter", template: "newsletter_snippet", content: {title: "Foo", body: "Foo123"}},
|
|
{id: "fxa", template: "fxa_signup_snippet", content: {title: "Foo", body: "Foo123"}},
|
|
];
|
|
export const FAKE_LOCAL_PROVIDER = {id: "onboarding", type: "local", localProvider: "FAKE_LOCAL_PROVIDER", enabled: true, cohort: 0};
|
|
export const FAKE_LOCAL_PROVIDERS = {FAKE_LOCAL_PROVIDER: {getMessages: () => FAKE_LOCAL_MESSAGES}};
|
|
|
|
export const FAKE_REMOTE_MESSAGES = [
|
|
{id: "qux", template: "simple_snippet", content: {title: "Qux", body: "hello world"}},
|
|
];
|
|
export const FAKE_REMOTE_PROVIDER = {id: "remotey", type: "remote", url: "http://fake.com/endpoint", enabled: true};
|
|
|
|
export const FAKE_REMOTE_SETTINGS_PROVIDER = {id: "remotey-settingsy", type: "remote-settings", bucket: "bucketname", enabled: true};
|
|
|
|
// Stubs methods on RemotePageManager
|
|
export class FakeRemotePageManager {
|
|
constructor() {
|
|
this.addMessageListener = sinon.stub();
|
|
this.sendAsyncMessage = sinon.stub();
|
|
this.removeMessageListener = sinon.stub();
|
|
this.browser = {
|
|
ownerGlobal: {
|
|
openTrustedLinkIn: sinon.stub(),
|
|
openLinkIn: sinon.stub(),
|
|
OpenBrowserWindow: sinon.stub(),
|
|
},
|
|
};
|
|
this.portID = "6000:2";
|
|
}
|
|
}
|