File tree 3 files changed +8
-2
lines changed
packages/google-cloud-compute
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ class Snapshot extends common.ServiceObject {
176
176
* @name Snapshot#compute
177
177
* @type {Compute }
178
178
*/
179
- this . compute = isDisk ? scope . compute : scope ;
179
+ this . compute = isDisk ? scope . zone . compute : scope ;
180
180
/**
181
181
* @name Snapshot#name
182
182
* @type {string }
Original file line number Diff line number Diff line change @@ -206,12 +206,13 @@ describe('Compute', () => {
206
206
return zone . disk ( DISK_NAME ) . getMetadata ( ) ;
207
207
} ) ;
208
208
209
- it ( 'should take a snapshot' , async ( ) => {
209
+ it ( 'should take and delete a snapshot' , async ( ) => {
210
210
const [ snapshot , operation ] = await disk
211
211
. snapshot ( generateName ( 'snapshot' ) )
212
212
. create ( ) ;
213
213
await operation . promise ( ) ;
214
214
await snapshot . getMetadata ( ) ;
215
+ await snapshot . delete ( ) ;
215
216
} ) ;
216
217
217
218
it ( 'should run operation as a promise' , async ( ) => {
Original file line number Diff line number Diff line change @@ -95,11 +95,16 @@ describe('Snapshot', function() {
95
95
assert . strictEqual ( this , scope ) ;
96
96
done ( ) ;
97
97
} ,
98
+ zone : {
99
+ compute : COMPUTE ,
100
+ } ,
98
101
} ;
99
102
100
103
const snapshot = new Snapshot ( scope , SNAPSHOT_NAME ) ;
101
104
assert ( snapshot instanceof ServiceObject ) ;
102
105
106
+ assert . strictEqual ( snapshot . compute , scope . zone . compute ) ;
107
+
103
108
const calledWith = snapshot . calledWith_ [ 0 ] ;
104
109
assert . strictEqual ( calledWith . methods . create , true ) ;
105
110
You can’t perform that action at this time.
0 commit comments