feat(external-entry): define Facebook business links
This commit is contained in:
@@ -9,6 +9,21 @@ import {
|
||||
shouldBindExternalFacebookIdentity,
|
||||
} from "../external_entry";
|
||||
|
||||
const facebookBusinessEntryCases = [
|
||||
["private-space", "elio", "chat", null, null, getCharacterRoutes("elio").chat, null],
|
||||
["private-space", "maya", "chat", null, null, getCharacterRoutes("maya").chat, null],
|
||||
["private-space", "nayeli", "chat", null, null, getCharacterRoutes("nayeli").chat, null],
|
||||
["voice", "elio", "chat", "promotion", "voice", getCharacterRoutes("elio").chat, "voice"],
|
||||
["voice", "maya", "chat", "promotion", "voice", getCharacterRoutes("maya").chat, "voice"],
|
||||
["voice", "nayeli", "chat", "promotion", "voice", getCharacterRoutes("nayeli").chat, "voice"],
|
||||
["image-pack", "elio", "private-zone", null, null, getCharacterRoutes("elio").privateZone, null],
|
||||
["image-pack", "maya", "private-zone", null, null, getCharacterRoutes("maya").privateZone, null],
|
||||
["image-pack", "nayeli", "private-zone", null, null, getCharacterRoutes("nayeli").privateZone, null],
|
||||
["coffee", "elio", "tip", null, null, getCharacterRoutes("elio").tip, null],
|
||||
["coffee", "maya", "tip", null, null, getCharacterRoutes("maya").tip, null],
|
||||
["coffee", "nayeli", "tip", null, null, getCharacterRoutes("nayeli").tip, null],
|
||||
] as const;
|
||||
|
||||
describe("external entry navigation", () => {
|
||||
it("defaults to chat", () => {
|
||||
expect(resolveExternalEntryTarget({})).toBe(ROUTES.chat);
|
||||
@@ -62,6 +77,26 @@ describe("external entry navigation", () => {
|
||||
).toBe(getCharacterRoutes("elio").privateZone);
|
||||
});
|
||||
|
||||
it.each(facebookBusinessEntryCases)(
|
||||
"routes Facebook business entry %s for %s",
|
||||
(
|
||||
_entry,
|
||||
character,
|
||||
target,
|
||||
mode,
|
||||
promotionType,
|
||||
expectedDestination,
|
||||
expectedPromotionType,
|
||||
) => {
|
||||
expect(resolveExternalEntryDestination({ target, character })).toBe(
|
||||
expectedDestination,
|
||||
);
|
||||
expect(
|
||||
resolveExternalEntryPromotionType({ mode, promotionType }),
|
||||
).toBe(expectedPromotionType);
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
["chat", "elio", getCharacterRoutes("elio").chat],
|
||||
["chat", "maya", getCharacterRoutes("maya").chat],
|
||||
|
||||
Reference in New Issue
Block a user