(
mocks: MockedGraphQLResponse[] = [],
isExplaining = true,
{
post = explainedPost,
follow = { factor: 1 },
}: {
post?: typeof explainedPost;
follow?: { kind?: string; factor: number };
} = {},
)
| 1016 | }; |
| 1017 | |
| 1018 | const renderExplained = ( |
| 1019 | mocks: MockedGraphQLResponse[] = [], |
| 1020 | isExplaining = true, |
| 1021 | { |
| 1022 | post = explainedPost, |
| 1023 | follow = { factor: 1 }, |
| 1024 | }: { |
| 1025 | post?: typeof explainedPost; |
| 1026 | follow?: { kind?: string; factor: number }; |
| 1027 | } = {}, |
| 1028 | ) => |
| 1029 | renderComponent( |
| 1030 | [ |
| 1031 | { |
| 1032 | request: { query: FEED_V2_EXPLAIN_QUERY, variables }, |
| 1033 | result: { |
| 1034 | data: { |
| 1035 | page: { |
| 1036 | pageInfo: defaultFeedPage.pageInfo, |
| 1037 | edges: [ |
| 1038 | { |
| 1039 | node: { |
| 1040 | __typename: 'FeedPostItem', |
| 1041 | feedMeta: null, |
| 1042 | post, |
| 1043 | explain: { |
| 1044 | lane: 'chal', |
| 1045 | v: 1, |
| 1046 | score: 0.81, |
| 1047 | position: 3, |
| 1048 | base: { value: 1.2, viewers: 1200 }, |
| 1049 | match: { |
| 1050 | tag: 'javascript', |
| 1051 | origin: 'declared', |
| 1052 | role: 'central', |
| 1053 | role_weight: 1, |
| 1054 | strength: 'strong', |
| 1055 | weight: 0.62, |
| 1056 | computed_weight: 0.62, |
| 1057 | factor: 1.62, |
| 1058 | }, |
| 1059 | follow, |
| 1060 | age: { days: 2.1, factor: 0.81 }, |
| 1061 | seen: { shows: 1, factor: 0.69 }, |
| 1062 | }, |
| 1063 | }, |
| 1064 | }, |
| 1065 | ], |
| 1066 | }, |
| 1067 | }, |
| 1068 | }, |
| 1069 | }, |
| 1070 | createTagsSettingsMock({ |
| 1071 | includeTags: ['javascript'], |
| 1072 | blockedTags: [], |
| 1073 | excludeSources: [], |
| 1074 | }), |
| 1075 | { |
no test coverage detected