@@ -30,8 +30,7 @@ describe('License: verifyLicense', () => {
3030 verifyLicense ( {
3131 releaseInfo : '__RELEASE_INFO__' ,
3232 licenseKey,
33- acceptedScopes : [ 'pro' , 'premium' ] ,
34- productScope : 'data-grid' ,
33+ packageName : 'x-data-grid-pro' ,
3534 } ) . status ,
3635 ) . to . throw ( 'MUI X: The release information is invalid. Not able to validate license.' ) ;
3736 } ) ;
@@ -42,8 +41,7 @@ describe('License: verifyLicense', () => {
4241 verifyLicense ( {
4342 releaseInfo : RELEASE_INFO ,
4443 licenseKey,
45- acceptedScopes : [ 'pro' , 'premium' ] ,
46- productScope : 'data-grid' ,
44+ packageName : 'x-data-grid-pro' ,
4745 } ) . status ,
4846 ) . to . equal ( LICENSE_STATUS . Valid ) ;
4947 } ) ;
@@ -62,8 +60,7 @@ describe('License: verifyLicense', () => {
6260 verifyLicense ( {
6361 releaseInfo : RELEASE_INFO ,
6462 licenseKey : expiredLicenseKey ,
65- acceptedScopes : [ 'pro' , 'premium' ] ,
66- productScope : 'data-grid' ,
63+ packageName : 'x-data-grid-pro' ,
6764 } ) . status ,
6865 ) . to . equal ( LICENSE_STATUS . ExpiredVersion ) ;
6966 } ) ;
@@ -75,8 +72,7 @@ describe('License: verifyLicense', () => {
7572 releaseInfo : RELEASE_INFO ,
7673 licenseKey :
7774 'b43ff5f9ac93f021855ff59ff0ba5220TkFNRTpNYC1VSSBTQVMsREVWRUxPUEVSX0NPVU5UPTEwLEVYUElSWT0xNTkxNzIzMDY3MDQyLFZFUlNJT049MS4yLjM' ,
78- acceptedScopes : [ 'pro' , 'premium' ] ,
79- productScope : 'data-grid' ,
75+ packageName : 'x-data-grid-pro' ,
8076 } ) . status ,
8177 ) . to . equal ( LICENSE_STATUS . Invalid ) ;
8278 } ) ;
@@ -106,8 +102,7 @@ describe('License: verifyLicense', () => {
106102 verifyLicense ( {
107103 releaseInfo : '__RELEASE_INFO__' ,
108104 licenseKey : licenseKeyPro ,
109- acceptedScopes : [ 'pro' , 'premium' ] ,
110- productScope : 'data-grid' ,
105+ packageName : 'x-data-grid-pro' ,
111106 } ) . status ,
112107 ) . to . throw ( 'MUI X: The release information is invalid. Not able to validate license.' ) ;
113108 } ) ;
@@ -119,8 +114,7 @@ describe('License: verifyLicense', () => {
119114 verifyLicense ( {
120115 releaseInfo : RELEASE_INFO ,
121116 licenseKey : licenseKeyPro ,
122- acceptedScopes : [ 'pro' , 'premium' ] ,
123- productScope : 'data-grid' ,
117+ packageName : 'x-data-grid-pro' ,
124118 } ) . status ,
125119 ) . to . equal ( LICENSE_STATUS . Valid ) ;
126120 } ) ;
@@ -131,8 +125,7 @@ describe('License: verifyLicense', () => {
131125 verifyLicense ( {
132126 releaseInfo : RELEASE_INFO ,
133127 licenseKey : licenseKeyPremium ,
134- acceptedScopes : [ 'premium' ] ,
135- productScope : 'data-grid' ,
128+ packageName : 'x-data-grid-premium' ,
136129 } ) . status ,
137130 ) . to . equal ( LICENSE_STATUS . Valid ) ;
138131 } ) ;
@@ -143,8 +136,7 @@ describe('License: verifyLicense', () => {
143136 verifyLicense ( {
144137 releaseInfo : RELEASE_INFO ,
145138 licenseKey : licenseKeyPro ,
146- acceptedScopes : [ 'premium' ] ,
147- productScope : 'data-grid' ,
139+ packageName : 'x-data-grid-premium' ,
148140 } ) . status ,
149141 ) . to . equal ( LICENSE_STATUS . OutOfScope ) ;
150142 } ) ;
@@ -165,8 +157,7 @@ describe('License: verifyLicense', () => {
165157 verifyLicense ( {
166158 releaseInfo : RELEASE_INFO ,
167159 licenseKey : expiredLicenseKey ,
168- acceptedScopes : [ 'pro' , 'premium' ] ,
169- productScope : 'data-grid' ,
160+ packageName : 'x-data-grid-pro' ,
170161 } ) . status ,
171162 ) . to . equal ( LICENSE_STATUS . Valid ) ;
172163 } ) ;
@@ -184,8 +175,7 @@ describe('License: verifyLicense', () => {
184175 verifyLicense ( {
185176 releaseInfo : RELEASE_INFO ,
186177 licenseKey : expiredLicenseKey ,
187- acceptedScopes : [ 'pro' , 'premium' ] ,
188- productScope : 'data-grid' ,
178+ packageName : 'x-data-grid-pro' ,
189179 } ) . status ,
190180 ) . to . equal ( LICENSE_STATUS . ExpiredAnnualGrace ) ;
191181 } ) ;
@@ -204,8 +194,7 @@ describe('License: verifyLicense', () => {
204194 verifyLicense ( {
205195 releaseInfo : RELEASE_INFO ,
206196 licenseKey : expiredLicenseKey ,
207- acceptedScopes : [ 'pro' , 'premium' ] ,
208- productScope : 'data-grid' ,
197+ packageName : 'x-data-grid-pro' ,
209198 } ) . status ,
210199 ) . to . equal ( LICENSE_STATUS . ExpiredAnnual ) ;
211200 } ) ;
@@ -223,8 +212,7 @@ describe('License: verifyLicense', () => {
223212 verifyLicense ( {
224213 releaseInfo : RELEASE_INFO ,
225214 licenseKey : expiredLicenseKey ,
226- acceptedScopes : [ 'pro' , 'premium' ] ,
227- productScope : 'data-grid' ,
215+ packageName : 'x-data-grid-pro' ,
228216 } ) . status ,
229217 ) . to . equal ( LICENSE_STATUS . Valid ) ;
230218 } ) ;
@@ -237,8 +225,7 @@ describe('License: verifyLicense', () => {
237225 releaseInfo : RELEASE_INFO ,
238226 licenseKey :
239227 'b43ff5f9ac93f021855ff59ff0ba5220TkFNRTpNYC1VSSBTQVMsREVWRUxPUEVSX0NPVU5UPTEwLEVYUElSWT0xNTkxNzIzMDY3MDQyLFZFUlNJT049MS4yLjM' ,
240- acceptedScopes : [ 'pro' , 'premium' ] ,
241- productScope : 'data-grid' ,
228+ packageName : 'x-data-grid-pro' ,
242229 } ) . status ,
243230 ) . to . equal ( LICENSE_STATUS . Invalid ) ;
244231 } ) ;
@@ -259,74 +246,99 @@ describe('License: verifyLicense', () => {
259246 verifyLicense ( {
260247 releaseInfo : RELEASE_INFO ,
261248 licenseKey : licenseKeyPro ,
262- acceptedScopes : [ 'pro' , 'premium' ] ,
263- productScope : 'data-grid' ,
249+ packageName : 'x-data-grid-pro' ,
264250 } ) . status ,
265251 ) . to . equal ( LICENSE_STATUS . Valid ) ;
266252 } ) ;
267253 } ) ;
268254
269255 describe ( 'key version: 2.2' , ( ) => {
270- const licenseKeyInitial = generateLicense ( {
256+ const proLicenseKeyInitial = generateLicense ( {
271257 expiryDate : new Date ( releaseDate . getTime ( ) + oneDayInMS ) ,
272258 orderNumber : 'MUI-123' ,
273259 scope : 'pro' ,
274260 licensingModel : 'annual' ,
275261 planVersion : 'initial' ,
276262 } ) ;
277263
278- const licenseKey2 = generateLicense ( {
264+ const premiumLicenseKeyInitial = generateLicense ( {
265+ expiryDate : new Date ( releaseDate . getTime ( ) + oneDayInMS ) ,
266+ orderNumber : 'MUI-123' ,
267+ scope : 'premium' ,
268+ licensingModel : 'annual' ,
269+ planVersion : 'initial' ,
270+ } ) ;
271+
272+ const proLicenseKeyQ32024 = generateLicense ( {
279273 expiryDate : new Date ( releaseDate . getTime ( ) + oneDayInMS ) ,
280274 orderNumber : 'MUI-123' ,
281275 scope : 'pro' ,
282276 licensingModel : 'annual' ,
283277 planVersion : 'Q3-2024' ,
284278 } ) ;
285279
286- it ( 'PlanVersion "initial" should not accept charts' , ( ) => {
280+ it ( 'PlanVersion "initial" should not accept x- charts-pro ' , ( ) => {
287281 process . env . NODE_ENV = 'production' ;
288282 expect (
289283 verifyLicense ( {
290284 releaseInfo : RELEASE_INFO ,
291- licenseKey : licenseKeyInitial ,
292- acceptedScopes : [ 'pro' , 'premium' ] ,
293- productScope : 'charts' ,
285+ licenseKey : proLicenseKeyInitial ,
286+ packageName : 'x-charts-pro' ,
294287 } ) . status ,
295288 ) . to . equal ( LICENSE_STATUS . NotAvailableInInitialProPlan ) ;
296289 } ) ;
297290
298- it ( 'PlanVersion "initial" should not accept tree-view' , ( ) => {
291+ it ( 'PlanVersion "initial" should not accept x- tree-view-pro ' , ( ) => {
299292 process . env . NODE_ENV = 'production' ;
300293 expect (
301294 verifyLicense ( {
302295 releaseInfo : RELEASE_INFO ,
303- licenseKey : licenseKeyInitial ,
304- acceptedScopes : [ 'pro' , 'premium' ] ,
305- productScope : 'tree-view' ,
296+ licenseKey : proLicenseKeyInitial ,
297+ packageName : 'x-tree-view-pro' ,
306298 } ) . status ,
307299 ) . to . equal ( LICENSE_STATUS . NotAvailableInInitialProPlan ) ;
308300 } ) ;
309301
310- it ( 'PlanVersion "Q3-2024" should accept charts' , ( ) => {
302+ it ( 'PlanVersion "Q3-2024" should accept x-charts-pro' , ( ) => {
303+ process . env . NODE_ENV = 'production' ;
304+ expect (
305+ verifyLicense ( {
306+ releaseInfo : RELEASE_INFO ,
307+ licenseKey : proLicenseKeyQ32024 ,
308+ packageName : 'x-charts-pro' ,
309+ } ) . status ,
310+ ) . to . equal ( LICENSE_STATUS . Valid ) ;
311+ } ) ;
312+
313+ it ( 'PlanVersion "Q3-2024" should accept x-tree-view-pro' , ( ) => {
314+ process . env . NODE_ENV = 'production' ;
315+ expect (
316+ verifyLicense ( {
317+ releaseInfo : RELEASE_INFO ,
318+ licenseKey : proLicenseKeyQ32024 ,
319+ packageName : 'x-tree-view-pro' ,
320+ } ) . status ,
321+ ) . to . equal ( LICENSE_STATUS . Valid ) ;
322+ } ) ;
323+
324+ it ( 'Premium with planVersion "initial" should accept x-tree-view-pro' , ( ) => {
311325 process . env . NODE_ENV = 'production' ;
312326 expect (
313327 verifyLicense ( {
314328 releaseInfo : RELEASE_INFO ,
315- licenseKey : licenseKey2 ,
316- acceptedScopes : [ 'pro' , 'premium' ] ,
317- productScope : 'charts' ,
329+ licenseKey : premiumLicenseKeyInitial ,
330+ packageName : 'x-tree-view-pro' ,
318331 } ) . status ,
319332 ) . to . equal ( LICENSE_STATUS . Valid ) ;
320333 } ) ;
321334
322- it ( 'PlanVersion "Q3-2024 " should accept tree-view ' , ( ) => {
335+ it ( 'Premium with planVersion "initial " should accept x-charts-pro ' , ( ) => {
323336 process . env . NODE_ENV = 'production' ;
324337 expect (
325338 verifyLicense ( {
326339 releaseInfo : RELEASE_INFO ,
327- licenseKey : licenseKey2 ,
328- acceptedScopes : [ 'pro' , 'premium' ] ,
329- productScope : 'tree-view' ,
340+ licenseKey : premiumLicenseKeyInitial ,
341+ packageName : 'x-charts-pro' ,
330342 } ) . status ,
331343 ) . to . equal ( LICENSE_STATUS . Valid ) ;
332344 } ) ;
0 commit comments