@@ -46,6 +46,7 @@ import {
4646 selectBulkLinkFailedAccounts ,
4747 selectBulkLinkWasInterrupted ,
4848 selectBulkLinkAccountProgress ,
49+ selectBenefits ,
4950 selectCampaigns ,
5051 selectCampaignsLoading ,
5152 selectCampaignsError ,
@@ -85,6 +86,7 @@ import {
8586 SeasonWayToEarnDto ,
8687 PointsEventDto ,
8788 OndoGmActivityEntryDto ,
89+ SubscriptionBenefitDto ,
8890} from '../../core/Engine/controllers/rewards-controller/types' ;
8991import { RootState } from '..' ;
9092import { RewardsState , AccountOptInBannerInfoStatus } from '.' ;
@@ -550,6 +552,16 @@ describe('Rewards selectors', () => {
550552 expect ( result . current ) . toEqual ( [ ] ) ;
551553 } ) ;
552554
555+ it ( 'returns empty array when season tiers are undefined' , ( ) => {
556+ const mockState = {
557+ rewards : { seasonTiers : undefined } ,
558+ } as unknown as RootState ;
559+ mockedUseSelector . mockImplementation ( ( selector ) => selector ( mockState ) ) ;
560+
561+ const { result } = renderHook ( ( ) => useSelector ( selectSeasonTiers ) ) ;
562+ expect ( result . current ) . toEqual ( [ ] ) ;
563+ } ) ;
564+
553565 it ( 'returns season tiers when set' , ( ) => {
554566 const mockTiers : SeasonTierDto [ ] = [
555567 {
@@ -605,6 +617,18 @@ describe('Rewards selectors', () => {
605617 expect ( result . current ) . toEqual ( [ ] ) ;
606618 } ) ;
607619
620+ it ( 'returns empty array when season activity types are undefined' , ( ) => {
621+ const mockState = {
622+ rewards : { seasonActivityTypes : undefined } ,
623+ } as unknown as RootState ;
624+ mockedUseSelector . mockImplementation ( ( selector ) => selector ( mockState ) ) ;
625+
626+ const { result } = renderHook ( ( ) =>
627+ useSelector ( selectSeasonActivityTypes ) ,
628+ ) ;
629+ expect ( result . current ) . toEqual ( [ ] ) ;
630+ } ) ;
631+
608632 it ( 'returns season activity types when set' , ( ) => {
609633 const mockActivityTypes : SeasonActivityTypeDto [ ] = [
610634 {
@@ -639,6 +663,16 @@ describe('Rewards selectors', () => {
639663 expect ( result . current ) . toEqual ( [ ] ) ;
640664 } ) ;
641665
666+ it ( 'returns empty array when season ways to earn are undefined' , ( ) => {
667+ const mockState = {
668+ rewards : { seasonWaysToEarn : undefined } ,
669+ } as unknown as RootState ;
670+ mockedUseSelector . mockImplementation ( ( selector ) => selector ( mockState ) ) ;
671+
672+ const { result } = renderHook ( ( ) => useSelector ( selectSeasonWaysToEarn ) ) ;
673+ expect ( result . current ) . toEqual ( [ ] ) ;
674+ } ) ;
675+
642676 it ( 'returns season ways to earn when set' , ( ) => {
643677 const mockWaysToEarn : SeasonWayToEarnDto [ ] = [
644678 {
@@ -1033,6 +1067,18 @@ describe('Rewards selectors', () => {
10331067 expect ( result . current ) . toHaveLength ( 0 ) ;
10341068 } ) ;
10351069
1070+ it ( 'returns empty array when account banner config is undefined' , ( ) => {
1071+ const mockState = {
1072+ rewards : { hideCurrentAccountNotOptedInBanner : undefined } ,
1073+ } as unknown as RootState ;
1074+ mockedUseSelector . mockImplementation ( ( selector ) => selector ( mockState ) ) ;
1075+
1076+ const { result } = renderHook ( ( ) =>
1077+ useSelector ( selectHideCurrentAccountNotOptedInBannerArray ) ,
1078+ ) ;
1079+ expect ( result . current ) . toEqual ( [ ] ) ;
1080+ } ) ;
1081+
10361082 it ( 'returns single account configuration when set' , ( ) => {
10371083 const mockAccountConfig : AccountOptInBannerInfoStatus = {
10381084 accountGroupId : 'keyring:wallet1/1' ,
@@ -3120,6 +3166,37 @@ describe('Rewards selectors', () => {
31203166 showUpcomingDate : false ,
31213167 } ;
31223168
3169+ describe ( 'selectBenefits' , ( ) => {
3170+ const mockBenefit : SubscriptionBenefitDto = {
3171+ id : 101 ,
3172+ longTitle : 'Premium Access' ,
3173+ shortDescription : 'Get premium perks' ,
3174+ longDescription : 'Unlock premium partner benefits.' ,
3175+ thumbnail : 'https://example.com/benefits/premium.png' ,
3176+ validFrom : '2026-01-01T00:00:00.000Z' ,
3177+ validTo : '2026-12-31T00:00:00.000Z' ,
3178+ actionDate : '2026-06-01T00:00:00.000Z' ,
3179+ url : 'https://example.com/claim' ,
3180+ chain : 'ethereum' ,
3181+ type : {
3182+ id : 1 ,
3183+ name : 'Partner' ,
3184+ } ,
3185+ } ;
3186+
3187+ it ( 'returns empty array when benefits are undefined' , ( ) => {
3188+ const state = createMockRootState ( {
3189+ benefits : undefined as unknown as SubscriptionBenefitDto [ ] ,
3190+ } ) ;
3191+ expect ( selectBenefits ( state ) ) . toEqual ( [ ] ) ;
3192+ } ) ;
3193+
3194+ it ( 'returns benefits when they exist' , ( ) => {
3195+ const state = createMockRootState ( { benefits : [ mockBenefit ] } ) ;
3196+ expect ( selectBenefits ( state ) ) . toEqual ( [ mockBenefit ] ) ;
3197+ } ) ;
3198+ } ) ;
3199+
31233200 describe ( 'selectCampaigns' , ( ) => {
31243201 it ( 'returns empty array when campaigns is empty' , ( ) => {
31253202 const mockState = { rewards : { campaigns : [ ] } } ;
@@ -3878,6 +3955,16 @@ describe('Rewards selectors', () => {
38783955 expect ( selectDismissedCampaignOutcomeToasts ( state ) ) . toEqual ( { } ) ;
38793956 } ) ;
38803957
3958+ it ( 'returns empty object when dismissed toasts are undefined' , ( ) => {
3959+ const state = createMockRootState ( {
3960+ dismissedCampaignOutcomeToasts : undefined as unknown as Record <
3961+ string ,
3962+ boolean
3963+ > ,
3964+ } ) ;
3965+ expect ( selectDismissedCampaignOutcomeToasts ( state ) ) . toEqual ( { } ) ;
3966+ } ) ;
3967+
38813968 it ( 'returns the dismissed toasts map' , ( ) => {
38823969 const dismissed = {
38833970 'campaign-1:sub-1:winner' : true ,
0 commit comments