Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/pages/MyKiva/MyKivaPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
:latest-loan="latestLoan"
:goal-refresh-key="goalRefreshKey"
:owned-giving-funds="ownedGivingFunds"
:fundraisers-row-enabled="fundraisersRowEnabled"
:goal-recommended-loan-enable="goalRecommendedLoanEnable"
:goal-in-review-enable="goalInReviewEnable"
:goal-in-review-in-progress-start="goalInReviewInProgressStart"
Expand Down Expand Up @@ -77,6 +78,7 @@ import { getContentfulEntries } from '#src/util/contentfulUtils';
const CURRENT_YEAR = new Date().getFullYear();
const GOALS_ROW_EXP_KEY = 'mykiva_goals_row';
const CO_RECOVERY_FUND_EXP_KEY = 'mykiva_co_recovery_fund';
const FUNDRAISERS_ROW_EXP_KEY = 'mykiva_fundraisers_row';

/**
* Options API parent needed to ensure WWwPage children options API preFetch works,
Expand Down Expand Up @@ -130,6 +132,7 @@ export default {
goalInReviewEnable: false,
goalInReviewInProgressStart: null,
goalsRowEnabled: false,
fundraisersRowEnabled: false,
shouldRenderFeaturedSlot: true,
coRecoveryFundExpEnabled: false,
};
Expand Down Expand Up @@ -236,6 +239,10 @@ export default {
query: experimentAssignmentQuery,
variables: { id: CO_RECOVERY_FUND_EXP_KEY },
}),
client.query({
query: experimentAssignmentQuery,
variables: { id: FUNDRAISERS_ROW_EXP_KEY },
}),
]).catch(error => {
logReadQueryError(error, 'myKivaPage Prefetch');
});
Expand Down Expand Up @@ -450,6 +457,18 @@ export default {
this.$kvTrackEvent,
'EXP-MP-3155-Aug2026'
);

initializeExperiment(
this.cookieStore,
this.apollo,
this.$route,
FUNDRAISERS_ROW_EXP_KEY,
version => {
this.fundraisersRowEnabled = version === 'b';
},
this.$kvTrackEvent,
'EXP-CIT-5265-Sep2026'
);
},
async mounted() {
try {
Expand Down
6 changes: 5 additions & 1 deletion src/pages/MyKiva/MyKivaPageContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
@view-goal-recap="openGoalRecapFromCard"
/>
</section>
<section class="tw-mt-4" id="mykiva-fundraisers">
<section v-if="fundraisersRowEnabled" class="tw-mt-4" id="mykiva-fundraisers">
<FundraisersSection :funds="ownedGivingFunds" />
</section>
<section class="tw-mt-4" id="mykiva-achievements">
Expand Down Expand Up @@ -336,6 +336,10 @@ export default {
type: Array,
default: () => [],
},
fundraisersRowEnabled: {
type: Boolean,
default: false,
},
goalRecommendedLoanEnable: {
type: Boolean,
default: false,
Expand Down
12 changes: 12 additions & 0 deletions test/unit/specs/pages/MyKiva/MyKivaPage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,18 @@ describe('MyKivaPage', () => {
expect(yearOnlyCalls[0].variables).toEqual({ year: new Date().getFullYear() });
});

it('prefetches the fundraisers row experiment assignment', async () => {
const client = { query: vi.fn().mockResolvedValue({ data: {} }) };

await MyKivaPage.apollo.preFetch({}, client, { route: { query: {} } });

const experimentIds = client.query.mock.calls
.map(call => call[0]?.variables?.id)
.filter(Boolean);

expect(experimentIds).toContain('mykiva_fundraisers_row');
});

// Regression: this was route-gated to /mykiva/next-steps, but both routes resolve to
// this same component, so Vue patches it in place and created() -> fetchMyKivaData()
// never re-runs. regionsData then stayed empty from the /mykiva render and the
Expand Down
6 changes: 6 additions & 0 deletions test/unit/specs/pages/MyKiva/MyKivaPageContent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ const makeBadge = (id, totalProgress, tierTargets) => ({
const IN_PROGRESS_RELEASE = new Date('2026-11-15T00:00:00Z');

describe('MyKivaPageContent', () => {
describe('fundraisersRowEnabled', () => {
it('defaults to off so the row stays hidden until the experiment assigns b', () => {
expect(MyKivaPageContent.props.fundraisersRowEnabled.default).toBe(false);
});
});

describe('allBadgesCompleted', () => {
const callComputed = heroBadgeData => {
const context = {
Expand Down
Loading