Skip to content

QA Testing Plan: Affiliates

This document covers QA test cases for the Affiliates business app located at /business/apps/affiliates. The app supports managing an affiliate program with approve/reject actions, viewing dashboard stats (active affiliates, total referrals, pending payouts), and managing payouts.

RoutePurpose
/business/apps/affiliatesDashboard with stats, affiliate list, approve/reject actions
/business/apps/affiliates/payoutsPayouts list with approve/reject actions
RouteActionMethodKey Fields
/business/apps/affiliatesapprovePOSTaffiliate_id
/business/apps/affiliatesrejectPOSTaffiliate_id
/business/apps/affiliates/payoutsapprovePOSTpayout_id
/business/apps/affiliates/payoutsrejectPOSTpayout_id

Test IDDescriptionPreconditionsStepsExpected ResultPriority
AFF-001Dashboard loads with statsUser is logged in as program owner with affiliates1. Navigate to /business/apps/affiliatesStats cards display: Active Affiliates (count of approved), Total Referrals, Pending Payouts (sum of commission amounts). Affiliate list is shown.P0
AFF-002Dashboard shows empty stateUser is logged in with no affiliates1. Navigate to /business/apps/affiliatesEmpty state with UsersIcon and “No affiliates yet.” message.P1
AFF-003Unauthenticated user gets empty dataUser is not logged in1. Navigate to /business/apps/affiliatesPage loads with empty affiliates array and stats: null. No crash.P1
AFF-004Payouts button navigates correctlyUser is logged in1. Click “Payouts” buttonNavigates to /business/apps/affiliates/payouts.P1
AFF-005Affiliate list shows user info and referral countUser has affiliates with referrals1. View affiliate listEach affiliate shows avatar/initial, full_name or username, referral count, join date.P1
AFF-006Status badges render correctlyAffiliates with pending, approved, rejected statuses exist1. View affiliate listpending = secondary, approved = default, rejected = destructive.P2
Test IDDescriptionPreconditionsStepsExpected ResultPriority
AFF-010Approve a pending affiliateUser is program owner, affiliate is pending1. Click the approve (check) button on a pending affiliateapprove action fires. Affiliate status updates to “approved”. Toast “Affiliate approved!” appears.P0
AFF-011Reject a pending affiliateUser is program owner, affiliate is pending1. Click the reject (X) button on a pending affiliatereject action fires. Affiliate status updates to “rejected”. Toast “Affiliate rejected.” appears.P0
AFF-012Approve/reject buttons only visible for pendingAffiliates with various statuses exist1. View affiliate listApprove and reject buttons only appear for affiliates with status “pending”.P0
AFF-013Approve action requires authenticationUser is not logged in1. POST to ?/approve with affiliate_idReturns 401 fail.P1
AFF-014Reject action requires authenticationUser is not logged in1. POST to ?/reject with affiliate_idReturns 401 fail.P1
AFF-015Approve scoped to program ownerUser is logged in but not the program owner1. POST to ?/approve with affiliate_id belonging to another ownerUpdate query matches on program_owner_id, so no rows are affected. Affiliate status remains unchanged.P1
AFF-016Reject scoped to program ownerUser is logged in but not the program owner1. POST to ?/reject with affiliate_id belonging to another ownerUpdate query matches on program_owner_id, so no rows are affected.P1
AFF-017Hidden input sends correct affiliate_idUser is program owner1. Inspect form markup for pending affiliateHidden input name="affiliate_id" contains the correct affiliate ID value.P2
Test IDDescriptionPreconditionsStepsExpected ResultPriority
AFF-020Referral count shown per affiliateAffiliates have referrals1. View affiliate listEach affiliate row shows {count} referrals from affiliate_referrals join.P1
AFF-021Pending payouts calculated from commissionsReferrals exist with commission_amount1. View dashboard statsPending Payouts equals sum of all commission_amount values for the program owner.P1
AFF-022Total referrals count matchesReferrals exist1. View dashboard statsTotal Referrals equals the count of rows in affiliate_referrals for the program owner.P1
Test IDDescriptionPreconditionsStepsExpected ResultPriority
AFF-030Payouts page loads with payout listUser is program owner with payouts1. Navigate to /business/apps/affiliates/payoutsPayout list loads with affiliate user info, ordered by newest first.P0
AFF-031Payouts page empty stateUser has no payouts1. Navigate to /business/apps/affiliates/payoutsEmpty payouts array. No crash.P1
AFF-032Approve a payoutUser is program owner1. Submit approve action with payout_idPayout status updates to “approved”. approved_at timestamp is set. Returns { approved: true }.P0
AFF-033Reject a payoutUser is program owner1. Submit reject action with payout_idPayout status updates to “rejected”. Returns { rejected: true }.P0
AFF-034Approve payout requires authenticationUser is not logged in1. POST to ?/approve with payout_idReturns 401 fail.P1
AFF-035Reject payout requires authenticationUser is not logged in1. POST to ?/reject with payout_idReturns 401 fail.P1
AFF-036Approve payout scoped to program ownerUser is not the program owner1. POST to ?/approve with payout_id belonging to another ownerUpdate matches on program_owner_id, so no rows are affected.P1
AFF-037Unauthenticated user gets empty payoutsUser is not logged in1. Navigate to /business/apps/affiliates/payoutsReturns empty payouts array. No crash.P1