@@ -13,25 +13,25 @@ describe('UploadUtils', () => {
1313 } ) ;
1414
1515 describe ( 'checkUploadSizeLimits' , ( ) => {
16- it ( 'should not throw when fetchLimits returns no maxUploadFileSize and size is under 100GB ' , async ( ) => {
16+ it ( 'should not throw when fetchLimits returns no maxUploadFileSize and size is under 10GB ' , async ( ) => {
1717 vi . spyOn ( UsageService . instance , 'fetchLimits' ) . mockResolvedValue ( undefined as never ) ;
1818
19- await expect ( UploadUtils . checkUploadSizeLimits ( 50 * 1024 * 1024 * 1024 ) ) . resolves . toBeUndefined ( ) ;
19+ await expect ( UploadUtils . checkUploadSizeLimits ( 5 * 1024 * 1024 * 1024 ) ) . resolves . toBeUndefined ( ) ;
2020 } ) ;
2121
2222 it ( 'should not throw when fetchLimits returns null' , async ( ) => {
2323 vi . spyOn ( UsageService . instance , 'fetchLimits' ) . mockResolvedValue ( null as never ) ;
2424
25- await expect ( UploadUtils . checkUploadSizeLimits ( 50 * 1024 * 1024 * 1024 ) ) . resolves . toBeUndefined ( ) ;
25+ await expect ( UploadUtils . checkUploadSizeLimits ( 5 * 1024 * 1024 * 1024 ) ) . resolves . toBeUndefined ( ) ;
2626 } ) ;
2727
2828 it ( 'should not throw when size is below the account upload limit' , async ( ) => {
2929 vi . spyOn ( UsageService . instance , 'fetchLimits' ) . mockResolvedValue ( {
30- maxUploadFileSize : 100 * 1024 * 1024 * 1024 ,
30+ maxUploadFileSize : 8 * 1024 * 1024 * 1024 ,
3131 versioning : { enabled : false , maxFileSize : 0 , retentionDays : 0 , maxVersions : 0 } ,
3232 } ) ;
3333
34- await expect ( UploadUtils . checkUploadSizeLimits ( 50 * 1024 * 1024 * 1024 ) ) . resolves . toBeUndefined ( ) ;
34+ await expect ( UploadUtils . checkUploadSizeLimits ( 5 * 1024 * 1024 * 1024 ) ) . resolves . toBeUndefined ( ) ;
3535 } ) ;
3636
3737 it ( 'should throw when size exceeds the account upload limit' , async ( ) => {
@@ -58,34 +58,34 @@ describe('UploadUtils', () => {
5858 await expect ( UploadUtils . checkUploadSizeLimits ( limitBytes ) ) . resolves . toBeUndefined ( ) ;
5959 } ) ;
6060
61- it ( 'should throw when size exceeds 100GB even if no account limit is set' , async ( ) => {
61+ it ( 'should throw when size exceeds 10GB even if no account limit is set' , async ( ) => {
6262 vi . spyOn ( UsageService . instance , 'fetchLimits' ) . mockResolvedValue ( undefined as never ) ;
6363
64- await expect ( UploadUtils . checkUploadSizeLimits ( 101 * 1024 * 1024 * 1024 ) ) . rejects . toThrow (
65- 'File is too big (more than 100 GB)' ,
64+ await expect ( UploadUtils . checkUploadSizeLimits ( 11 * 1024 * 1024 * 1024 ) ) . rejects . toThrow (
65+ 'File is too big (more than 10 GB)' ,
6666 ) ;
6767 } ) ;
6868
69- it ( 'should throw when size > 100GB ' , async ( ) => {
69+ it ( 'should throw when size > 10GB ' , async ( ) => {
7070 vi . spyOn ( UsageService . instance , 'fetchLimits' ) . mockResolvedValue ( {
71- maxUploadFileSize : 200 * 1024 * 1024 * 1024 ,
71+ maxUploadFileSize : 20 * 1024 * 1024 * 1024 ,
7272 versioning : { enabled : false , maxFileSize : 0 , retentionDays : 0 , maxVersions : 0 } ,
7373 } ) ;
7474
75- await expect ( UploadUtils . checkUploadSizeLimits ( 150 * 1024 * 1024 * 1024 ) ) . rejects . toThrow (
76- 'File is too big (more than 100 GB)' ,
75+ await expect ( UploadUtils . checkUploadSizeLimits ( 15 * 1024 * 1024 * 1024 ) ) . rejects . toThrow (
76+ 'File is too big (more than 10 GB)' ,
7777 ) ;
7878 } ) ;
7979
80- it ( 'should use the account limit when it is below 100GB ' , async ( ) => {
81- const limitBytes = 50 * 1024 * 1024 * 1024 ;
80+ it ( 'should use the account limit when it is below the default limit ' , async ( ) => {
81+ const limitBytes = 8 * 1024 * 1024 * 1024 ;
8282 vi . spyOn ( UsageService . instance , 'fetchLimits' ) . mockResolvedValue ( {
8383 maxUploadFileSize : limitBytes ,
8484 versioning : { enabled : false , maxFileSize : 0 , retentionDays : 0 , maxVersions : 0 } ,
8585 } ) ;
8686
87- await expect ( UploadUtils . checkUploadSizeLimits ( 75 * 1024 * 1024 * 1024 ) ) . rejects . toThrow (
88- `File is too big (${ FormatUtils . humanFileSize ( 75 * 1024 * 1024 * 1024 ) } exceeds account ` +
87+ await expect ( UploadUtils . checkUploadSizeLimits ( 9 * 1024 * 1024 * 1024 ) ) . rejects . toThrow (
88+ `File is too big (${ FormatUtils . humanFileSize ( 9 * 1024 * 1024 * 1024 ) } exceeds account ` +
8989 `upload limit of ${ FormatUtils . humanFileSize ( limitBytes ) } )` ,
9090 ) ;
9191 } ) ;
0 commit comments