@@ -192,7 +192,7 @@ describe('ARC32: app-factory-and-app-client', () => {
192192 expect ( app . return ) . toBe ( 'arg_io' )
193193 } )
194194
195- test ( 'Deploy app - update detects extra pages as breaking change' , async ( ) => {
195+ test ( 'Deploy app - update detects extra page deficit as a breaking change' , async ( ) => {
196196 let appFactory = localnet . algorand . client . getAppFactory ( {
197197 appSpec : asJson ( smallAppArc56Json ) ,
198198 defaultSender : localnet . context . testAccount ,
@@ -232,6 +232,37 @@ describe('ARC32: app-factory-and-app-client', () => {
232232 expect ( appCreateResult . appId ) . not . toEqual ( appAppendResult . appId )
233233 } )
234234
235+ test ( 'Deploy app - update detects extra page surplus as a non breaking change' , async ( ) => {
236+ let appFactory = localnet . algorand . client . getAppFactory ( {
237+ appSpec : asJson ( smallAppArc56Json ) ,
238+ defaultSender : localnet . context . testAccount ,
239+ } )
240+
241+ const { result : appCreateResult } = await appFactory . deploy ( {
242+ updatable : true ,
243+ createParams : {
244+ extraProgramPages : 1 ,
245+ } ,
246+ } )
247+
248+ expect ( appCreateResult . operationPerformed ) . toBe ( 'create' )
249+
250+ // Update the app to a larger program which needs more pages than the previous program
251+ appFactory = localnet . algorand . client . getAppFactory ( {
252+ appSpec : asJson ( largeAppArc56Json ) ,
253+ defaultSender : localnet . context . testAccount ,
254+ } )
255+
256+ const { result : appUpdateResult } = await appFactory . deploy ( {
257+ updatable : true ,
258+ onSchemaBreak : OnSchemaBreak . Fail ,
259+ onUpdate : OnUpdate . UpdateApp ,
260+ } )
261+
262+ expect ( appUpdateResult . operationPerformed ) . toBe ( 'update' )
263+ expect ( appCreateResult . appId ) . toEqual ( appUpdateResult . appId )
264+ } )
265+
235266 test ( 'Deploy app - replace' , async ( ) => {
236267 const { result : createdApp } = await factory . deploy ( {
237268 deployTimeParams : {
0 commit comments