@@ -216,6 +216,127 @@ describe('buildSummaryTables', () => {
216216 expect ( flakyTable ) . toStrictEqual ( FLAKY_TABLE )
217217 } )
218218
219+ it ( 'should show skipped tests when includeSkipped=true but includePassed=false' , async ( ) => {
220+ // This tests the key use case: showing only failed and skipped tests, without passed tests
221+ const testResult = await parseTestReports (
222+ 'checkName' ,
223+ 'summary' ,
224+ 'test_results/tests/utils/target/surefire-reports/TEST-action.surefire.report.calc.StringUtilsTest.xml' ,
225+ '*' ,
226+ true , // Parse all tests
227+ true ,
228+ true ,
229+ [ ] ,
230+ undefined ,
231+ '/'
232+ )
233+
234+ // Build with includePassed=false but includeSkipped=true
235+ const [ , detailTable ] = buildSummaryTables (
236+ [ testResult ] ,
237+ false , // includePassed - don't show passed tests
238+ true , // includeSkipped - but DO show skipped tests
239+ true , // detailedSummary
240+ false , // flakySummary
241+ false , // verboseSummary
242+ false // skipSuccessSummary
243+ )
244+
245+ const flatResults = detailTable . flat ( )
246+
247+ // Should include skipped tests
248+ const hasSkippedTests = flatResults . some ( cell => typeof cell === 'string' && cell . includes ( '⚠️ skipped' ) )
249+ expect ( hasSkippedTests ) . toBe ( true )
250+
251+ // Should include failed tests
252+ const hasFailedTests = flatResults . some ( cell => typeof cell === 'string' && cell . includes ( '❌ failure' ) )
253+ expect ( hasFailedTests ) . toBe ( true )
254+
255+ // Should NOT include passed tests
256+ const hasPassedTests = flatResults . some ( cell => typeof cell === 'string' && cell . includes ( '✅ passed' ) )
257+ expect ( hasPassedTests ) . toBe ( false )
258+ } )
259+
260+ it ( 'should hide both passed and skipped when both include flags are false' , async ( ) => {
261+ const testResult = await parseTestReports (
262+ 'checkName' ,
263+ 'summary' ,
264+ 'test_results/tests/utils/target/surefire-reports/TEST-action.surefire.report.calc.StringUtilsTest.xml' ,
265+ '*' ,
266+ true , // Parse all tests
267+ true ,
268+ true ,
269+ [ ] ,
270+ undefined ,
271+ '/'
272+ )
273+
274+ // Build with both includePassed=false and includeSkipped=false
275+ const [ , detailTable ] = buildSummaryTables (
276+ [ testResult ] ,
277+ false , // includePassed - don't show passed tests
278+ false , // includeSkipped - don't show skipped tests either
279+ true , // detailedSummary
280+ false , // flakySummary
281+ false , // verboseSummary
282+ false // skipSuccessSummary
283+ )
284+
285+ const flatResults = detailTable . flat ( )
286+
287+ // Should NOT include skipped tests
288+ const hasSkippedTests = flatResults . some ( cell => typeof cell === 'string' && cell . includes ( '⚠️ skipped' ) )
289+ expect ( hasSkippedTests ) . toBe ( false )
290+
291+ // Should include failed tests
292+ const hasFailedTests = flatResults . some ( cell => typeof cell === 'string' && cell . includes ( '❌ failure' ) )
293+ expect ( hasFailedTests ) . toBe ( true )
294+
295+ // Should NOT include passed tests
296+ const hasPassedTests = flatResults . some ( cell => typeof cell === 'string' && cell . includes ( '✅ passed' ) )
297+ expect ( hasPassedTests ) . toBe ( false )
298+ } )
299+
300+ it ( 'should show both passed and skipped when both include flags are true' , async ( ) => {
301+ const testResult = await parseTestReports (
302+ 'checkName' ,
303+ 'summary' ,
304+ 'test_results/tests/utils/target/surefire-reports/TEST-action.surefire.report.calc.StringUtilsTest.xml' ,
305+ '*' ,
306+ true , // Parse all tests
307+ true ,
308+ true ,
309+ [ ] ,
310+ undefined ,
311+ '/'
312+ )
313+
314+ // Build with both includePassed=true and includeSkipped=true
315+ const [ , detailTable ] = buildSummaryTables (
316+ [ testResult ] ,
317+ true , // includePassed - show passed tests
318+ true , // includeSkipped - show skipped tests
319+ true , // detailedSummary
320+ false , // flakySummary
321+ false , // verboseSummary
322+ false // skipSuccessSummary
323+ )
324+
325+ const flatResults = detailTable . flat ( )
326+
327+ // Should include skipped tests
328+ const hasSkippedTests = flatResults . some ( cell => typeof cell === 'string' && cell . includes ( '⚠️ skipped' ) )
329+ expect ( hasSkippedTests ) . toBe ( true )
330+
331+ // Should include failed tests
332+ const hasFailedTests = flatResults . some ( cell => typeof cell === 'string' && cell . includes ( '❌ failure' ) )
333+ expect ( hasFailedTests ) . toBe ( true )
334+
335+ // Should include passed tests
336+ const hasPassedTests = flatResults . some ( cell => typeof cell === 'string' && cell . includes ( '✅ passed' ) )
337+ expect ( hasPassedTests ) . toBe ( true )
338+ } )
339+
219340 it ( 'should include flaky tests in summary even when includePassed is false' , async ( ) => {
220341 const testResult = await parseTestReports (
221342 'checkName' ,
0 commit comments