constants.js (3272B)
1 export const CHILD_TO_PARENT_MESSAGE_NAME = "ASRouter:child-to-parent"; 2 export const PARENT_TO_CHILD_MESSAGE_NAME = "ASRouter:parent-to-child"; 3 4 export const FAKE_LOCAL_MESSAGES = [ 5 { 6 id: "foo", 7 template: "milestone_message", 8 content: { title: "Foo", body: "Foo123" }, 9 }, 10 { 11 id: "foo1", 12 template: "fancy_template", 13 bundled: 2, 14 order: 1, 15 content: { title: "Foo1", body: "Foo123-1" }, 16 }, 17 { 18 id: "foo2", 19 template: "fancy_template", 20 bundled: 2, 21 order: 2, 22 content: { title: "Foo2", body: "Foo123-2" }, 23 }, 24 { 25 id: "bar", 26 template: "fancy_template", 27 content: { title: "Foo", body: "Foo123" }, 28 }, 29 { id: "baz", content: { title: "Foo", body: "Foo123" } }, 30 { 31 id: "newsletter", 32 template: "fancy_template", 33 content: { title: "Foo", body: "Foo123" }, 34 }, 35 { 36 id: "fxa", 37 template: "fancy_template", 38 content: { title: "Foo", body: "Foo123" }, 39 }, 40 { 41 id: "belowsearch", 42 template: "fancy_template", 43 content: { text: "Foo" }, 44 }, 45 { 46 id: "experimentL10n", 47 template: "fancy_template", 48 content: { text: { $l10n: { text: "UniqueText" } } }, 49 }, 50 ]; 51 export const FAKE_LOCAL_PROVIDER = { 52 id: "onboarding", 53 type: "local", 54 localProvider: "FAKE_LOCAL_PROVIDER", 55 enabled: true, 56 cohort: 0, 57 }; 58 export const FAKE_LOCAL_PROVIDERS = { 59 FAKE_LOCAL_PROVIDER: { 60 getMessages: () => Promise.resolve(FAKE_LOCAL_MESSAGES), 61 }, 62 }; 63 64 export const FAKE_REMOTE_MESSAGES = [ 65 { 66 id: "qux", 67 template: "fancy_template", 68 content: { title: "Qux", body: "hello world" }, 69 }, 70 ]; 71 export const FAKE_REMOTE_PROVIDER = { 72 id: "remotey", 73 type: "remote", 74 url: "http://fake.com/endpoint", 75 enabled: true, 76 }; 77 78 export const FAKE_REMOTE_SETTINGS_PROVIDER = { 79 id: "remotey-settingsy", 80 type: "remote-settings", 81 collection: "collectionname", 82 enabled: true, 83 }; 84 85 const notificationText = new String("Fake notification text"); // eslint-disable-line 86 notificationText.attributes = { tooltiptext: "Fake tooltip text" }; 87 88 export const FAKE_RECOMMENDATION = { 89 id: "fake_id", 90 template: "cfr_doorhanger", 91 content: { 92 category: "cfrDummy", 93 bucket_id: "fake_bucket_id", 94 notification_text: notificationText, 95 info_icon: { 96 label: "Fake Info Icon Label", 97 sumo_path: "a_help_path_fragment", 98 }, 99 heading_text: "Fake Heading Text", 100 icon_class: "Fake Icon class", 101 addon: { 102 title: "Fake Addon Title", 103 author: "Fake Addon Author", 104 icon: "a_path_to_some_icon", 105 rating: "4.2", 106 users: "1234", 107 amo_url: "a_path_to_amo", 108 }, 109 descriptionDetails: { 110 steps: [{ string_id: "cfr-features-step1" }], 111 }, 112 text: "Here is the recommendation text body", 113 buttons: { 114 primary: { 115 label: { string_id: "primary_button_id" }, 116 action: { 117 id: "primary_action", 118 data: {}, 119 }, 120 }, 121 secondary: [ 122 { 123 label: { string_id: "secondary_button_id" }, 124 action: { id: "secondary_action" }, 125 }, 126 { 127 label: { string_id: "secondary_button_id_2" }, 128 }, 129 { 130 label: { string_id: "secondary_button_id_3" }, 131 action: { id: "secondary_action" }, 132 }, 133 ], 134 }, 135 }, 136 };