@@ -116,6 +116,37 @@ describe("plugins.container", () => {
116
116
} )
117
117
} )
118
118
119
+ describe ( "getDeploymentImageId" , ( ) => {
120
+ it ( "should return module name with module version if there is a Dockerfile and no image name set" , async ( ) => {
121
+ const config = cloneDeep ( baseConfig )
122
+ const module = await getTestModule ( config )
123
+
124
+ td . replace ( containerHelpers , "hasDockerfile" , async ( ) => true )
125
+
126
+ expect ( await containerHelpers . getDeploymentImageId ( module ) ) . to . equal ( "test:1234" )
127
+ } )
128
+
129
+ it ( "should return image name with module version if there is a Dockerfile and image name is set" , async ( ) => {
130
+ const config = cloneDeep ( baseConfig )
131
+ config . spec . image = "some/image:1.1"
132
+ const module = await getTestModule ( config )
133
+
134
+ td . replace ( containerHelpers , "hasDockerfile" , async ( ) => true )
135
+
136
+ expect ( await containerHelpers . getDeploymentImageId ( module ) ) . to . equal ( "some/image:1234" )
137
+ } )
138
+
139
+ it ( "should return configured image tag if there is no Dockerfile" , async ( ) => {
140
+ const config = cloneDeep ( baseConfig )
141
+ config . spec . image = "some/image:1.1"
142
+ const module = await getTestModule ( config )
143
+
144
+ td . replace ( containerHelpers , "hasDockerfile" , async ( ) => false )
145
+
146
+ expect ( await containerHelpers . getDeploymentImageId ( module ) ) . to . equal ( "some/image:1.1" )
147
+ } )
148
+ } )
149
+
119
150
describe ( "getDockerfilePathFromModule" , ( ) => {
120
151
it ( "should return the absolute default Dockerfile path" , async ( ) => {
121
152
const module = await getTestModule ( baseConfig )
0 commit comments