Skip to content

Commit

Permalink
Adding an 'everything' row, see #88
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Apr 16, 2020
1 parent bf519fd commit 98d16ca
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion js/report/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ const popup = ( triggerNode, message ) => {
Property.multilink( [ reportProperty, expandedReposProperty, sortProperty ], ( report, expandedRepos, sort ) => {
let tests = [];

const everythingName = '(everything)';

tests.push( {
names: [ everythingName ],
indices: _.range( 0, report.testNames.length )
} );

// scan to determine what tests we are showing
report.testNames.forEach( ( names, index ) => {
if ( !expandedRepos.includes( names[ 0 ] ) ) {
Expand Down Expand Up @@ -216,6 +223,9 @@ Property.multilink( [ reportProperty, expandedReposProperty, sortProperty ], ( r

let testLabels = tests.map( test => {
const label = new Text( test.names.join( ' : ' ), { font: new PhetFont( { size: 12 } ) } );
if ( test.names[ 0 ] === everythingName ) {
label.fill = '#999';
}
label.addInputListener( new FireListener( {
fire: () => {
const topLevelName = test.names[ 0 ];
Expand Down Expand Up @@ -288,7 +298,9 @@ Property.multilink( [ reportProperty, expandedReposProperty, sortProperty ], ( r
untestedCount++;
}
if ( snapshotTest.m ) {
messages = messages.concat( snapshotTest.m );
messages = messages.concat( snapshotTest.m.map( message => {
return `${report.testNames[ index ].join( ' : ' )}\n${message}`;
} ) );
}
}
else {
Expand Down

0 comments on commit 98d16ca

Please sign in to comment.