File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3036,7 +3036,7 @@ describe('storage', function () {
30363036 await file . save ( FILE_CONTENTS ) ;
30373037
30383038 const [ metadata ] = await file . getMetadata ( ) ;
3039- assert . ok ( metadata . kmsKeyName || metadata . customerEncryption ) ;
3039+ assert . ok ( metadata . customerEncryption ) ;
30403040 } ) ;
30413041
30423042 it ( 'should retain defaultKmsKeyName when updating enforcement settings independently' , async ( ) => {
Original file line number Diff line number Diff line change @@ -3303,7 +3303,7 @@ describe('Bucket', () => {
33033303
33043304 describe ( 'setMetadata' , ( ) => {
33053305 describe ( 'encryption enforcement' , ( ) => {
3306- it ( 'should correctly format restrictionMode for all enforcement types' , async ( ) => {
3306+ it ( 'should correctly format restrictionMode for all enforcement types' , ( ) => {
33073307 const effectiveTime = '2026-02-02T12:00:00Z' ;
33083308 const encryptionMetadata = {
33093309 encryption : {
@@ -3365,12 +3365,18 @@ describe('Bucket', () => {
33653365 } ,
33663366 } ;
33673367
3368- bucket . setMetadata = ( metadata : BucketMetadata ) => {
3369- assert . strictEqual (
3370- metadata . encryption ?. customerSuppliedEncryptionEnforcementConfig
3371- ?. restrictionMode ,
3372- 'FullyRestricted'
3373- ) ;
3368+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3369+ ( bucket as any ) . request = ( reqOpts : { json : BucketMetadata } ) => {
3370+ const expectedEncryption = {
3371+ defaultKmsKeyName : 'kms-key-name' ,
3372+ googleManagedEncryptionEnforcementConfig : {
3373+ restrictionMode : 'FullyRestricted' ,
3374+ } ,
3375+ customerSuppliedEncryptionEnforcementConfig : {
3376+ restrictionMode : 'FullyRestricted' ,
3377+ } ,
3378+ } ;
3379+ assert . deepStrictEqual ( reqOpts . json . encryption , expectedEncryption ) ;
33743380 done ( ) ;
33753381 } ;
33763382
You can’t perform that action at this time.
0 commit comments