feat: export business ability metrics
This commit is contained in:
@@ -1624,6 +1624,11 @@ describe("market-content-entry", () => {
|
||||
{ authorId: "222", authorName: "达人 B", price21To60s: "¥22,000" }
|
||||
]);
|
||||
const buildAudienceProfileCsv = vi.fn(() => "profile-csv");
|
||||
const loadBusinessAbility = vi.fn(async () => ({
|
||||
estimates: {},
|
||||
status: "success" as const,
|
||||
videos: {}
|
||||
}));
|
||||
const loadAudienceProfile = vi.fn(async (_record, target) => {
|
||||
if (target.source === "fansDistribution" && target.authorType === 5) {
|
||||
return {
|
||||
@@ -1648,6 +1653,7 @@ describe("market-content-entry", () => {
|
||||
const controller = trackController(createMarketController({
|
||||
buildAudienceProfileCsv,
|
||||
document,
|
||||
loadBusinessAbility,
|
||||
loadAudienceProfile,
|
||||
loadAuthorMetrics: async () => ({
|
||||
success: false,
|
||||
@@ -1666,6 +1672,10 @@ describe("market-content-entry", () => {
|
||||
await waitForMockCall(buildAudienceProfileCsv, 40, 50);
|
||||
|
||||
expect(loadAudienceProfile).toHaveBeenCalledTimes(3);
|
||||
expect(loadBusinessAbility).toHaveBeenCalledTimes(1);
|
||||
expect(loadBusinessAbility).toHaveBeenCalledWith(
|
||||
expect.objectContaining({ authorId: "222" })
|
||||
);
|
||||
expect(loadAudienceProfile.mock.calls.map(([, target]) => target)).toEqual([
|
||||
{ linkType: 5, source: "audienceDistribution" },
|
||||
{ authorType: 1, source: "fansDistribution" },
|
||||
@@ -1678,6 +1688,7 @@ describe("market-content-entry", () => {
|
||||
fans: expect.objectContaining({ status: "success" }),
|
||||
longtimeFans: expect.objectContaining({ status: "success" })
|
||||
},
|
||||
businessAbility: expect.objectContaining({ status: "success" }),
|
||||
record: expect.objectContaining({ authorId: "222" })
|
||||
}
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user