@@ -195,39 +195,39 @@ describe('util.submit-addon', () => {
195195 ) ;
196196 } ) ;
197197
198- it ( 'includes source data to be patched if versionSource defined for new addon' , async ( ) => {
199- const versionSource = 'path/to/source/zip' ;
198+ it ( 'includes source data to be patched if submissionSource defined for new addon' , async ( ) => {
199+ const submissionSource = 'path/to/source/zip' ;
200200 await signAddon ( {
201201 ...signAddonDefaults ,
202- versionSource ,
202+ submissionSource ,
203203 } ) ;
204204
205- sinon . assert . calledWith ( fileFromSyncStub , versionSource ) ;
205+ sinon . assert . calledWith ( fileFromSyncStub , submissionSource ) ;
206206 sinon . assert . calledWith (
207207 postNewAddonStub ,
208208 uploadUuid ,
209209 signAddonDefaults . savedIdPath ,
210210 { } ,
211- { source : fakeFileFromSync } ,
211+ { version : { source : fakeFileFromSync } } ,
212212 ) ;
213213 } ) ;
214214
215- it ( 'includes source data to be patched if versionSource defined for new version' , async ( ) => {
216- const versionSource = 'path/to/source/zip' ;
215+ it ( 'includes source data to be patched if submissionSource defined for new version' , async ( ) => {
216+ const submissionSource = 'path/to/source/zip' ;
217217 const id = '@thisID' ;
218218 await signAddon ( {
219219 ...signAddonDefaults ,
220- versionSource ,
220+ submissionSource ,
221221 id,
222222 } ) ;
223223
224- sinon . assert . calledWith ( fileFromSyncStub , versionSource ) ;
224+ sinon . assert . calledWith ( fileFromSyncStub , submissionSource ) ;
225225 sinon . assert . calledWith (
226226 putVersionStub ,
227227 uploadUuid ,
228228 id ,
229229 { } ,
230- { source : fakeFileFromSync } ,
230+ { version : { source : fakeFileFromSync } } ,
231231 ) ;
232232 } ) ;
233233 } ) ;
@@ -1006,7 +1006,7 @@ describe('util.submit-addon', () => {
10061006 } ) ;
10071007
10081008 describe ( 'doFormDataPatch called correctly' , ( ) => {
1009- const versionPatchData = { source : 'somesource' } ;
1009+ const patchData = { version : { source : 'somesource' } } ;
10101010 const metaDataJson = { some : 'metadata' } ;
10111011 const newVersionId = 123456 ;
10121012 const editUrl = 'http://some/url' ;
@@ -1034,57 +1034,57 @@ describe('util.submit-addon', () => {
10341034 doFormDataPatchStub . reset ( ) ;
10351035 } ) ;
10361036
1037- it ( 'calls doFormDataPatch if versionPatchData is defined for postNewAddon' , async ( ) => {
1037+ it ( 'calls doFormDataPatch if patchData.version is defined for postNewAddon' , async ( ) => {
10381038 const saveIdToFileStub = sinon . stub ( ) . resolves ( ) ;
10391039 const savedIdPath = 'some/saved/id/path' ;
10401040 await stubbedClient . postNewAddon (
10411041 uploadUuid ,
10421042 savedIdPath ,
10431043 metaDataJson ,
1044- versionPatchData ,
1044+ patchData ,
10451045 saveIdToFileStub ,
10461046 ) ;
10471047
10481048 sinon . assert . calledWith (
10491049 doFormDataPatchStub ,
1050- versionPatchData ,
1050+ patchData . version ,
10511051 addonId ,
10521052 newVersionId ,
10531053 ) ;
10541054 } ) ;
10551055
1056- it ( 'calls doFormDataPatch if versionPatchData is defined for putVersion' , async ( ) => {
1056+ it ( 'calls doFormDataPatch if patchData.version is defined for putVersion' , async ( ) => {
10571057 await stubbedClient . putVersion (
10581058 uploadUuid ,
10591059 addonId ,
10601060 metaDataJson ,
1061- versionPatchData ,
1061+ patchData ,
10621062 ) ;
10631063
10641064 sinon . assert . called ( doFormDataPatchStub ) ;
10651065 sinon . assert . calledWith (
10661066 doFormDataPatchStub ,
1067- versionPatchData ,
1067+ patchData . version ,
10681068 addonId ,
10691069 newVersionId ,
10701070 ) ;
10711071 } ) ;
10721072
1073- it ( 'does not call doFormDataPatch is versionPatchData is undefined for postNewAddon' , async ( ) => {
1073+ it ( 'does not call doFormDataPatch is patchData.version is undefined for postNewAddon' , async ( ) => {
10741074 const saveIdToFileStub = sinon . stub ( ) . resolves ( ) ;
10751075 const savedIdPath = 'some/saved/id/path' ;
10761076 await stubbedClient . postNewAddon (
10771077 uploadUuid ,
10781078 savedIdPath ,
10791079 metaDataJson ,
1080- undefined ,
1080+ { } ,
10811081 saveIdToFileStub ,
10821082 ) ;
10831083
10841084 sinon . assert . notCalled ( doFormDataPatchStub ) ;
10851085 } ) ;
10861086
1087- it ( 'does not call doFormDataPatch is versionPatchData is undefined for putVersion' , async ( ) => {
1087+ it ( 'does not call doFormDataPatch is patchData.version is undefined for putVersion' , async ( ) => {
10881088 await stubbedClient . putVersion ( uploadUuid , addonId , metaDataJson ) ;
10891089
10901090 sinon . assert . notCalled ( doFormDataPatchStub ) ;
0 commit comments