test(e2e): add paid media flow coverage
This commit is contained in:
@@ -127,6 +127,86 @@ export function createWeeklyLimitChatSendResponse(
|
||||
};
|
||||
}
|
||||
|
||||
export const paidImageMessageId = "msg_photo_paywall_001";
|
||||
export const paidImageUrl =
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+/p9sAAAAASUVORK5CYII=";
|
||||
|
||||
export const paidImageChatSendResponse = {
|
||||
reply: "I can show you that photo after you activate VIP.",
|
||||
audioUrl: "",
|
||||
messageId: paidImageMessageId,
|
||||
isGuest: true,
|
||||
timestamp: 1_782_180_725_000,
|
||||
image: {
|
||||
type: "elio_schedule",
|
||||
url: paidImageUrl,
|
||||
},
|
||||
lockDetail: {
|
||||
locked: true,
|
||||
showContent: true,
|
||||
showUpgrade: true,
|
||||
reason: "image",
|
||||
hint: "Activate VIP to unlock the full photo.",
|
||||
detail: null,
|
||||
},
|
||||
};
|
||||
|
||||
export function createPaidImageHistoryResponse(unlocked: boolean) {
|
||||
return {
|
||||
messages: [
|
||||
{
|
||||
role: "assistant",
|
||||
type: "image",
|
||||
content: unlocked
|
||||
? ""
|
||||
: "I can show you that photo after you activate VIP.",
|
||||
id: paidImageMessageId,
|
||||
created_at: "2026-06-30T00:00:00.000Z",
|
||||
audioUrl: null,
|
||||
image: {
|
||||
type: "elio_schedule",
|
||||
url: paidImageUrl,
|
||||
},
|
||||
lockDetail: unlocked
|
||||
? {
|
||||
locked: false,
|
||||
showContent: true,
|
||||
showUpgrade: false,
|
||||
reason: null,
|
||||
hint: null,
|
||||
detail: null,
|
||||
}
|
||||
: paidImageChatSendResponse.lockDetail,
|
||||
},
|
||||
],
|
||||
total: 1,
|
||||
limit: 50,
|
||||
offset: 0,
|
||||
isVip: unlocked,
|
||||
privateFreeLimit: 0,
|
||||
privateUsedToday: 0,
|
||||
privateCanViewFree: false,
|
||||
};
|
||||
}
|
||||
|
||||
export const paidImageUnlockHistoryResponse = {
|
||||
unlocked: true,
|
||||
reason: "ok",
|
||||
totalLocked: 1,
|
||||
unlockedCount: 1,
|
||||
privateCount: 0,
|
||||
imageCount: 1,
|
||||
voiceCount: 0,
|
||||
requiredCredits: 0,
|
||||
currentCredits: 0,
|
||||
remainingCredits: 0,
|
||||
shortfallCredits: 0,
|
||||
costsByMessage: {
|
||||
[paidImageMessageId]: 0,
|
||||
},
|
||||
messageIds: [paidImageMessageId],
|
||||
};
|
||||
|
||||
export const paymentPlansResponse = {
|
||||
plans: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user