Add regression test for app manager init

If we had it eearlier, it would have prevented #1148.
When init is called, withImagesFromDockerAndDB in images.ts is called as well.

Change-type: patch
Signed-off-by: Roman Mazur <roman@balena.io>
This commit is contained in:
Roman Mazur 2019-11-21 16:05:51 +02:00
parent 8de85a6a53
commit f487711ba4
No known key found for this signature in database
GPG Key ID: 9459886EFE6EE2F6

View File

@ -142,6 +142,7 @@ describe 'ApplicationManager', ->
})
stub(@applications.docker, 'getNetworkGateway').returns(Promise.resolve('172.17.0.1'))
stub(@applications.docker, 'listContainers').returns(Promise.resolve([]))
stub(@applications.docker, 'listImages').returns(Promise.resolve([]))
stub(Service, 'extendEnvVars').callsFake (env) ->
env['ADDITIONAL_ENV_VAR'] = 'foo'
return env
@ -195,6 +196,9 @@ describe 'ApplicationManager', ->
@applications.docker.listContainers.restore()
Service.extendEnvVars.restore()
it 'should init', ->
@applications.init()
it 'infers a start step when all that changes is a running state', ->
Promise.join(
@normaliseCurrent(currentState[0])