@@ -13,7 +13,7 @@ describe('Composer Non-Major PR', () => {
13
13
baseBranch : 'main' ,
14
14
} ,
15
15
}
16
- prGenerator = new PullRequestGenerator ( mockConfig )
16
+ prGenerator = new PullRequestGenerator ( )
17
17
} )
18
18
19
19
it ( 'should include Composer updates in non-major grouped PR' , async ( ) => {
@@ -86,13 +86,13 @@ describe('Composer Non-Major PR', () => {
86
86
expect ( prBody ) . toContain ( '### GitHub Actions' )
87
87
expect ( prBody ) . toContain ( 'actions/checkout' )
88
88
89
- // Verify Composer package links
90
- expect ( prBody ) . toContain ( 'https://packagist.org/packages /monolog%2Fmonolog ' )
91
- expect ( prBody ) . toContain ( 'https://packagist.org/packages /phpunit%2Fphpunit ' )
89
+ // Verify Composer package links - they now go to homepage/source, not packagist
90
+ expect ( prBody ) . toContain ( '([source]( https://redirect.github.com/Seldaek /monolog)) ' )
91
+ expect ( prBody ) . toContain ( '([source]( https://redirect.github.com/sebastianbergmann /phpunit)) ' )
92
92
93
- // Verify version changes in Composer section
94
- expect ( prBody ) . toContain ( '`3.7.0` -> ` 3.8.0`' )
95
- expect ( prBody ) . toContain ( '`10.5.0` -> ` 10.5.2`' )
93
+ // Verify constraint-style version changes in Composer section
94
+ expect ( prBody ) . toContain ( '`^ 3.7.0 -> ^ 3.8.0`' )
95
+ expect ( prBody ) . toContain ( '`^ 10.5.0 -> ^ 10.5.2`' )
96
96
} )
97
97
98
98
it ( 'should handle non-major PR with only Composer updates' , async ( ) => {
@@ -160,6 +160,28 @@ describe('Composer Non-Major PR', () => {
160
160
161
161
// Should have the same format as npm dependencies (no file column)
162
162
expect ( prBody ) . toContain ( '| Package | Change | Age | Adoption | Passing | Confidence |' )
163
+
164
+ // Should have the same columns as npm dependencies
165
+ expect ( prBody ) . toContain ( '| Package | Change | Age | Adoption | Passing | Confidence |' )
166
+ expect ( prBody ) . toContain ( '|---|---|---|---|---|---|' )
167
+
168
+ // Should have the new table format with dependency and update type columns
169
+ expect ( prBody ) . toContain ( '| Package | Change | Age | Adoption | Passing | Confidence | Type | Update |' )
170
+ expect ( prBody ) . toContain ( '|---|---|---|---|---|---|---|---|' )
171
+
172
+ // Should show constraint-style changes for actual test packages
173
+ expect ( prBody ) . toContain ( '^6.4.0 -> ^6.4.12' )
174
+ expect ( prBody ) . toContain ( '^1.10.0 -> ^1.12.0' )
175
+
176
+ // Should have confidence badges
177
+ expect ( prBody ) . toContain ( '[
178
+ expect ( prBody ) . toContain ( '[
179
+ expect ( prBody ) . toContain ( '[
180
+ expect ( prBody ) . toContain ( '[
181
+
182
+ // Should show dependency types
183
+ expect ( prBody ) . toContain ( 'require' )
184
+ expect ( prBody ) . toContain ( 'require-dev' )
163
185
} )
164
186
165
187
it ( 'should deduplicate composer packages and show enhanced links' , async ( ) => {
@@ -178,6 +200,8 @@ describe('Composer Non-Major PR', () => {
178
200
name : 'monolog/monolog' ,
179
201
repository : 'https://github.com/Seldaek/monolog' ,
180
202
description : 'Sends your logs to files, sockets, inboxes, databases and various web services' ,
203
+ latestVersion : '3.8.0' ,
204
+ versions : [ '3.7.0' , '3.8.0' ] ,
181
205
} ,
182
206
} ,
183
207
{
@@ -191,6 +215,8 @@ describe('Composer Non-Major PR', () => {
191
215
name : 'monolog/monolog' ,
192
216
repository : 'https://github.com/Seldaek/monolog' ,
193
217
description : 'Sends your logs to files, sockets, inboxes, databases and various web services' ,
218
+ latestVersion : '3.8.0' ,
219
+ versions : [ '3.7.0' , '3.8.0' ] ,
194
220
} ,
195
221
} ,
196
222
{
@@ -238,6 +264,8 @@ describe('Composer Non-Major PR', () => {
238
264
name : 'monolog/monolog' ,
239
265
repository : 'https://github.com/Seldaek/monolog' ,
240
266
description : 'Sends your logs to files, sockets, inboxes, databases and various web services' ,
267
+ latestVersion : '3.8.0' ,
268
+ versions : [ '3.7.0' , '3.8.0' ] ,
241
269
} ,
242
270
} ,
243
271
] ,
@@ -248,17 +276,23 @@ describe('Composer Non-Major PR', () => {
248
276
249
277
const prBody = await prGenerator . generateBody ( testGroup )
250
278
251
- // Should format like npm : [packageName](repoUrl ) ([source](sourceUrl ))
252
- expect ( prBody ) . toContain ( '[monolog/monolog](https://github.com/Seldaek/monolog/tree/master ) ([source](https://github.com/Seldaek/monolog/tree/master ))' )
279
+ // Should format like Renovate : [packageName](homepage ) ([source](redirect.github.com ))
280
+ expect ( prBody ) . toContain ( '[monolog/monolog](https://github.com/Seldaek/monolog) ([source](https://redirect. github.com/Seldaek/monolog))' )
253
281
254
- // Should have the same columns as npm dependencies
255
- expect ( prBody ) . toContain ( '| Package | Change | Age | Adoption | Passing | Confidence |' )
256
- expect ( prBody ) . toContain ( '|---|---|---|---|---|---|' )
282
+ // Should have the new table format with dependency and update type columns
283
+ expect ( prBody ) . toContain ( '| Package | Change | Age | Adoption | Passing | Confidence | Type | Update | ' )
284
+ expect ( prBody ) . toContain ( '|---|---|---|---|---|---|---|---| ' )
257
285
258
- // Should have confidence badges
286
+ // Should show constraint-style changes
287
+ expect ( prBody ) . toContain ( '^3.7.0 -> ^3.8.0' )
288
+
289
+ // Should have confidence badges with normalized versions
259
290
expect ( prBody ) . toContain ( '[
260
291
expect ( prBody ) . toContain ( '[
261
292
expect ( prBody ) . toContain ( '[
262
293
expect ( prBody ) . toContain ( '[
294
+
295
+ // Should show dependency type
296
+ expect ( prBody ) . toContain ( '| require | minor |' )
263
297
} )
264
298
} )
0 commit comments