@@ -67,6 +67,20 @@ describe('Generate sponsors data', () => {
6767 return `import type { Sponsor } from './sponsors';\n\nexport const gold: Sponsor[] = [${ golds . length > 0 ? '\n' + goldsArray + ',\n' : '' } ];\n` ;
6868 } ;
6969
70+ const createExpectedPlatinumSponsorsContent = ( platinumSponsors : Array < { name : string ; url : string ; img : string } > ) => {
71+ const platinumSponsorsArray = platinumSponsors
72+ . map (
73+ platinumSponsor => ` {
74+ name: '${ platinumSponsor . name } ',
75+ url: '${ platinumSponsor . url } ',
76+ img: '${ platinumSponsor . img } ',
77+ }` ,
78+ )
79+ . join ( ',\n' ) ;
80+
81+ return `import type { Sponsor } from './sponsors';\n\nexport const platinum: Sponsor[] = [${ platinumSponsors . length > 0 ? '\n' + platinumSponsorsArray + ',\n' : '' } ];\n` ;
82+ } ;
83+
7084 it . each ( [
7185 {
7286 sponsorType : 'backers' ,
@@ -121,6 +135,18 @@ describe('Generate sponsors data', () => {
121135 } ,
122136 ] ,
123137 } ,
138+ {
139+ sponsorType : 'platinum sponsors' ,
140+ filePath : '.vitepress/data/sponsors/platinumSponsors.ts' ,
141+ contentGenerator : createExpectedPlatinumSponsorsContent ,
142+ expectedData : [
143+ {
144+ name : 'Kaelan Ryder' ,
145+ url : 'https://opencollective.com/kaelan-ryder' ,
146+ img : '/sponsors/kaelan-ryder.png' ,
147+ } ,
148+ ] ,
149+ } ,
124150 ] ) ( 'should generate $sponsorType data from open collective api' , async ( { filePath, contentGenerator, expectedData } ) => {
125151 setupMocks ( ) ;
126152 ( global . fetch as any ) . mockImplementation ( createMockFetchForMembers ( seed4jMembersJson ) ) ;
@@ -156,6 +182,12 @@ describe('Generate sponsors data', () => {
156182 filePath : '.vitepress/data/sponsors/golds.ts' ,
157183 contentGenerator : createExpectedGoldsContent ,
158184 } ,
185+ {
186+ tierToFilter : 'Platinum sponsor' ,
187+ sponsorType : 'platinum sponsors' ,
188+ filePath : '.vitepress/data/sponsors/platinumSponsors.ts' ,
189+ contentGenerator : createExpectedPlatinumSponsorsContent ,
190+ }
159191 ] ) (
160192 'should generate empty $sponsorType when does not have sponsors for its specific tier' ,
161193 async ( { tierToFilter, filePath, contentGenerator } ) => {
@@ -200,6 +232,12 @@ describe('Generate sponsors data', () => {
200232 filePath : '.vitepress/data/sponsors/golds.ts' ,
201233 contentGenerator : createExpectedGoldsContent ,
202234 } ,
235+ {
236+ sponsorType : 'platinum sponsors' ,
237+ tier : 'Platinum sponsor' ,
238+ filePath : '.vitepress/data/sponsors/platinumSponsors.ts' ,
239+ contentGenerator : createExpectedPlatinumSponsorsContent ,
240+ }
203241 ] ) (
204242 'should give preference to use the user website instead of the open collective profile url for $sponsorType' ,
205243 async ( { tier, filePath, contentGenerator } ) => {
@@ -274,6 +312,12 @@ describe('Generate sponsors data', () => {
274312 filePath : '.vitepress/data/sponsors/golds.ts' ,
275313 contentGenerator : createExpectedGoldsContent ,
276314 } ,
315+ {
316+ sponsorType : 'platinum sponsors' ,
317+ tier : 'Platinum sponsor' ,
318+ filePath : '.vitepress/data/sponsors/platinumSponsors.ts' ,
319+ contentGenerator : createExpectedPlatinumSponsorsContent ,
320+ }
277321 ] ) ( 'should download image from open collective api for $sponsorType' , async ( { tier, filePath, contentGenerator } ) => {
278322 setupMocks ( ) ;
279323 const seed4jMembersWithImageJson : Seed4jMember [ ] = [
@@ -324,6 +368,7 @@ describe('Generate sponsors data', () => {
324368 { sponsorType : 'bronzes' , tier : 'Bronze sponsor' } ,
325369 { sponsorType : 'silvers' , tier : 'Silver sponsor' } ,
326370 { sponsorType : 'golds' , tier : 'Gold sponsor' } ,
371+ { sponsorType : 'platinum sponsors' , tier : 'Platinum sponsor' } ,
327372 ] ) ( 'should use the seed4j logo as a placeholder for open collective members without an image for $sponsorType' , async ( { tier } ) => {
328373 setupMocks ( ) ;
329374 const seed4jMembersWithoutImageJson : Seed4jMember [ ] = [
@@ -366,6 +411,7 @@ describe('Generate sponsors data', () => {
366411 { tier : 'Bronze sponsor' , sponsorType : 'bronzes' , filePath : '.vitepress/data/sponsors/bronzes.ts' } ,
367412 { tier : 'Silver sponsor' , sponsorType : 'silvers' , filePath : '.vitepress/data/sponsors/silvers.ts' } ,
368413 { tier : 'Gold sponsor' , sponsorType : 'golds' , filePath : '.vitepress/data/sponsors/golds.ts' } ,
414+ { tier : 'Platinum sponsor' , sponsorType : 'platinum sponsors' , filePath : '.vitepress/data/sponsors/platinumSponsors.ts' } ,
369415 ] ) (
370416 'should prevent overwriting an existing user image with seed4j logo even if the user does not have an image from the open collective api for $sponsorType' ,
371417 async ( { tier, filePath } ) => {
@@ -648,5 +694,27 @@ describe('Generate sponsors data', () => {
648694 github : null ,
649695 website : null ,
650696 } ,
697+ {
698+ MemberId : 721012 ,
699+ createdAt : '2025-09-08 17:00' ,
700+ type : 'USER' ,
701+ role : 'BACKER' ,
702+ tier : 'Platinum sponsor' ,
703+ isActive : true ,
704+ totalAmountDonated : 500 ,
705+ currency : 'USD' ,
706+ lastTransactionAt : '2025-09-08 17:00' ,
707+ lastTransactionAmount : 500 ,
708+ profile : 'https://opencollective.com/kaelan-ryder' ,
709+ name : 'Kaelan Ryder' ,
710+ company : null ,
711+ description : null ,
712+ image : null ,
713+ email : null ,
714+ newsletterOptIn : null ,
715+ twitter : null ,
716+ github : null ,
717+ website : null ,
718+ } ,
651719 ] ;
652720} ) ;
0 commit comments