@@ -70,14 +70,15 @@ describe("getDeploymentImageRef", () => {
7070 projectRef : testProjectRef ,
7171 nextVersion : "20250630.1" ,
7272 environmentType : "DEVELOPMENT" ,
73+ deploymentShortCode : "test1234" ,
7374 } ) ;
7475
7576 // Check the image ref structure and that it contains expected parts
7677 expect ( imageRef . imageRef ) . toMatch (
7778 new RegExp (
7879 `^${ escapeHostForRegex (
7980 "registry.example.com"
80- ) } /${ testNamespace } /${ testProjectRef } :20250630\\.1\\.development\\.[a-z0-9]{8} $`
81+ ) } /${ testNamespace } /${ testProjectRef } :20250630\\.1\\.development\\.test1234 $`
8182 )
8283 ) ;
8384 expect ( imageRef . isEcr ) . toBe ( false ) ;
@@ -99,13 +100,14 @@ describe("getDeploymentImageRef", () => {
99100 projectRef : testProjectRef2 ,
100101 nextVersion : "20250630.1" ,
101102 environmentType : "DEVELOPMENT" ,
103+ deploymentShortCode : "test1234" ,
102104 } ) ;
103105
104106 expect ( imageRef1 . imageRef ) . toMatch (
105107 new RegExp (
106108 `^${ escapeHostForRegex (
107109 testHost
108- ) } /${ testNamespace } /${ testProjectRef2 } :20250630\\.1\\.development\\.[a-z0-9]{8} $`
110+ ) } /${ testNamespace } /${ testProjectRef2 } :20250630\\.1\\.development\\.test1234 $`
109111 )
110112 ) ;
111113 expect ( imageRef1 . isEcr ) . toBe ( true ) ;
@@ -124,13 +126,14 @@ describe("getDeploymentImageRef", () => {
124126 projectRef : testProjectRef2 ,
125127 nextVersion : "20250630.2" ,
126128 environmentType : "DEVELOPMENT" ,
129+ deploymentShortCode : "test1234" ,
127130 } ) ;
128131
129132 expect ( imageRef2 . imageRef ) . toMatch (
130133 new RegExp (
131134 `^${ escapeHostForRegex (
132135 testHost
133- ) } /${ testNamespace } /${ testProjectRef2 } :20250630\\.2\\.development\\.[a-z0-9]{8} $`
136+ ) } /${ testNamespace } /${ testProjectRef2 } :20250630\\.2\\.development\\.test1234 $`
134137 )
135138 ) ;
136139 expect ( imageRef2 . isEcr ) . toBe ( true ) ;
@@ -153,13 +156,14 @@ describe("getDeploymentImageRef", () => {
153156 projectRef : testProjectRef ,
154157 nextVersion : "20250630.2" ,
155158 environmentType : "PRODUCTION" ,
159+ deploymentShortCode : "test1234" ,
156160 } ) ;
157161
158162 expect ( imageRef . imageRef ) . toMatch (
159163 new RegExp (
160164 `^${ escapeHostForRegex (
161165 testHost
162- ) } /${ testNamespace } /${ testProjectRef } :20250630\\.2\\.production\\.[a-z0-9]{8} $`
166+ ) } /${ testNamespace } /${ testProjectRef } :20250630\\.2\\.production\\.test1234 $`
163167 )
164168 ) ;
165169 expect ( imageRef . isEcr ) . toBe ( true ) ;
@@ -183,6 +187,7 @@ describe("getDeploymentImageRef", () => {
183187 projectRef : testProjectRef ,
184188 nextVersion : sameVersion ,
185189 environmentType : sameEnvironmentType ,
190+ deploymentShortCode : "test1234" ,
186191 } ) ;
187192
188193 const secondImageRef = await getDeploymentImageRef ( {
@@ -198,21 +203,22 @@ describe("getDeploymentImageRef", () => {
198203 projectRef : testProjectRef ,
199204 nextVersion : sameVersion ,
200205 environmentType : sameEnvironmentType ,
206+ deploymentShortCode : "test4321" ,
201207 } ) ;
202208
203209 // Even with the same environment type and version, the image refs should be different due to random suffix
204210 expect ( firstImageRef . imageRef ) . toMatch (
205211 new RegExp (
206212 `^${ escapeHostForRegex (
207213 "registry.example.com"
208- ) } /${ testNamespace } /${ testProjectRef } :${ sameVersion } \\.preview\\.[a-z0-9]{8} $`
214+ ) } /${ testNamespace } /${ testProjectRef } :${ sameVersion } \\.preview\\.test1234 $`
209215 )
210216 ) ;
211217 expect ( secondImageRef . imageRef ) . toMatch (
212218 new RegExp (
213219 `^${ escapeHostForRegex (
214220 "registry.example.com"
215- ) } /${ testNamespace } /${ testProjectRef } :${ sameVersion } \\.preview\\.[a-z0-9]{8} $`
221+ ) } /${ testNamespace } /${ testProjectRef } :${ sameVersion } \\.preview\\.test4321 $`
216222 )
217223 ) ;
218224 expect ( firstImageRef . imageRef ) . not . toBe ( secondImageRef . imageRef ) ;
0 commit comments