@@ -281,9 +281,9 @@ describe('ProjectConfigStore.save', () => {
281281 it ( 'merges into the sole existing block rather than replacing it' , ( ) => {
282282 const store = storeFor ( { main : { uid : 'p1' , organizationUid : 'org1' , name : 'old-name' } } ) ;
283283
284- store . save ( { name : 'new-name ' } ) ;
284+ store . save ( { organizationUid : 'org2 ' } ) ;
285285
286- expect ( fileAt ( store ) ) . toEqual ( { main : { uid : 'p1' , organizationUid : 'org1 ' , name : 'new -name' } } ) ;
286+ expect ( fileAt ( store ) ) . toEqual ( { main : { uid : 'p1' , organizationUid : 'org2 ' , name : 'old -name' } } ) ;
287287 } ) ;
288288
289289 it ( 'updates every branch block and discards none of them' , ( ) => {
@@ -302,14 +302,14 @@ describe('ProjectConfigStore.save', () => {
302302 } ,
303303 } ) ;
304304
305- store . save ( { uid : 'p1' , name : 'renamed ' } ) ;
305+ store . save ( { uid : 'p1' , organizationUid : 'org2 ' } ) ;
306306
307307 expect ( fileAt ( store ) ) . toEqual ( {
308- main : { uid : 'p1' , organizationUid : 'org1 ' , name : 'renamed ' , environments : [ { uid : 'e1' , name : 'Default' } ] } ,
308+ main : { uid : 'p1' , organizationUid : 'org2 ' , name : 'my-site ' , environments : [ { uid : 'e1' , name : 'Default' } ] } ,
309309 'feature/checkout' : {
310310 uid : 'p1' ,
311- organizationUid : 'org1 ' ,
312- name : 'renamed ' ,
311+ organizationUid : 'org2 ' ,
312+ name : 'my-site ' ,
313313 environments : [ { uid : 'e2' , name : 'Preview' } ] ,
314314 } ,
315315 } ) ;
@@ -321,8 +321,8 @@ describe('ProjectConfigStore.save', () => {
321321 staging : { uid : 'p2' , organizationUid : 'org1' } ,
322322 } ) ;
323323
324- expect ( ( ) => store . save ( { name : 'renamed ' } ) ) . toThrow ( UsageError ) ;
325- expect ( ( ) => store . save ( { name : 'renamed ' } ) ) . toThrow ( 'main, staging' ) ;
324+ expect ( ( ) => store . save ( { organizationUid : 'org2 ' } ) ) . toThrow ( UsageError ) ;
325+ expect ( ( ) => store . save ( { organizationUid : 'org2 ' } ) ) . toThrow ( 'main, staging' ) ;
326326 expect ( fileAt ( store ) ) . toEqual ( {
327327 main : { uid : 'p1' , organizationUid : 'org1' } ,
328328 staging : { uid : 'p2' , organizationUid : 'org1' } ,
@@ -332,8 +332,8 @@ describe('ProjectConfigStore.save', () => {
332332 it ( 'refuses to write when the sole existing block names a different project' , ( ) => {
333333 const store = storeFor ( { main : { uid : 'p1' , organizationUid : 'org1' , name : 'other-site' } } ) ;
334334
335- expect ( ( ) => store . save ( { uid : 'p2' , organizationUid : 'org1' , name : 'my-site' } ) ) . toThrow ( UsageError ) ;
336- expect ( ( ) => store . save ( { uid : 'p2' , organizationUid : 'org1' , name : 'my-site' } ) ) . toThrow (
335+ expect ( ( ) => store . save ( { uid : 'p2' , organizationUid : 'org1' } ) ) . toThrow ( UsageError ) ;
336+ expect ( ( ) => store . save ( { uid : 'p2' , organizationUid : 'org1' } ) ) . toThrow (
337337 `The config file at '${ store . path } ' already names project p1. Delete it or pass --config with another path.` ,
338338 ) ;
339339 expect ( fileAt ( store ) ) . toEqual ( { main : { uid : 'p1' , organizationUid : 'org1' , name : 'other-site' } } ) ;
@@ -370,7 +370,7 @@ describe('ProjectConfigStore.save', () => {
370370
371371 it ( 'writes the file so that a later load reads back exactly what was saved' , ( ) => {
372372 const store = new ProjectConfigStore ( tempPath ( ) ) ;
373- const config = { uid : 'p1' , organizationUid : 'org1' , name : 'my-site' } ;
373+ const config = { uid : 'p1' , organizationUid : 'org1' } ;
374374
375375 store . save ( config ) ;
376376
@@ -389,11 +389,11 @@ describe('ProjectConfigStore.save', () => {
389389 const store = new ProjectConfigStore ( path ) ;
390390
391391 const loaded = store . load ( ) ;
392- store . save ( { name : 'renamed ' } ) ;
392+ store . save ( { organizationUid : 'org1 ' } ) ;
393393
394- expect ( loaded ) . toEqual ( { organizationUid : null , name : 'my-site' } ) ;
394+ expect ( loaded ) . toEqual ( { organizationUid : null } ) ;
395395 expect ( JSON . parse ( readFileSync ( path , 'utf8' ) ) ) . toEqual ( {
396- project : { uid : 42 , organizationUid : null , name : 'renamed ' , environments : [ { uid : 'e1' } ] , extra : true } ,
396+ project : { uid : 42 , organizationUid : 'org1' , name : 'my-site ' , environments : [ { uid : 'e1' } ] , extra : true } ,
397397 } ) ;
398398 } ) ;
399399
0 commit comments