@@ -959,6 +959,46 @@ describe('storage', () => {
959959 assert . strictEqual ( metadata . storageClass , 'MULTI_REGIONAL' ) ;
960960 } ) ;
961961
962+ describe ( 'locationType' , ( ) => {
963+ const types = [ 'multi-region' , 'region' , 'dual-region' ] ;
964+
965+ beforeEach ( ( ) => {
966+ delete bucket . metadata ;
967+ } ) ;
968+
969+ it ( 'should be available from getting a bucket' , async ( ) => {
970+ const [ metadata ] = await bucket . getMetadata ( ) ;
971+ assert ( types . includes ( metadata . locationType ) ) ;
972+ } ) ;
973+
974+ it ( 'should be available from creating a bucket' , async ( ) => {
975+ const [ bucket ] = await storage . createBucket ( generateName ( ) ) ;
976+ assert ( types . includes ( bucket . metadata . locationType ) ) ;
977+ return bucket . delete ( ) ;
978+ } ) ;
979+
980+ it ( 'should be available from listing buckets' , async ( ) => {
981+ const [ buckets ] = await storage . getBuckets ( ) ;
982+
983+ assert ( buckets . length > 0 ) ;
984+
985+ buckets . forEach ( bucket => {
986+ assert ( types . includes ( bucket . metadata . locationType ) ) ;
987+ } ) ;
988+ } ) ;
989+
990+ it ( 'should be available from setting retention policy' , async ( ) => {
991+ await bucket . setRetentionPeriod ( RETENTION_DURATION_SECONDS ) ;
992+ assert ( types . includes ( bucket . metadata . locationType ) ) ;
993+ await bucket . removeRetentionPeriod ( ) ;
994+ } ) ;
995+
996+ it ( 'should be available from updating a bucket' , async ( ) => {
997+ await bucket . setLabels ( { a : 'b' } ) ;
998+ assert ( types . includes ( bucket . metadata . locationType ) ) ;
999+ } ) ;
1000+ } ) ;
1001+
9621002 describe ( 'labels' , ( ) => {
9631003 const LABELS = {
9641004 label : 'labelvalue' , // no caps or spaces allowed (?)
0 commit comments