From 4a3f3a30ee91fc528e4c3b5aff23786b8241843e Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Wed, 15 Apr 2020 17:31:22 -0600 Subject: [PATCH] A few fixes/improvements to CT tests --- js/local-report.js | 12 +++++++----- js/local-server.js | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/js/local-report.js b/js/local-report.js index 9d575d3..6b0c682 100644 --- a/js/local-report.js +++ b/js/local-report.js @@ -85,10 +85,12 @@ const reportNode = new scenery.Node(); reportProperty.link( report => { const testLabels = report.testNames.map( names => new scenery.Text( names.join( ' : ' ), { fontSize: 12 } ) ); + const padding = 3; + const snapshotLabels = report.snapshots.map( snapshot => new scenery.VBox( { spacing: 2, children: [ - ...new Date( 1586988043041 ).toLocaleString().replace( ',', '' ).replace( ' AM', 'am' ).replace( ' PM', 'pm' ).split( ' ' ).map( str => new scenery.Text( str, { fontSize: 10 } ) ) + ...new Date( snapshot.timestamp ).toLocaleString().replace( ',', '' ).replace( ' AM', 'am' ).replace( ' PM', 'pm' ).split( ' ' ).map( str => new scenery.Text( str, { fontSize: 10 } ) ) ], cursor: 'pointer' } ) ); @@ -103,8 +105,8 @@ reportProperty.link( report => { const test = _.find( snapshot.tests, test => _.isEqual( names, test.names ) ); const background = new scenery.Rectangle( 0, 0, maxSnapshotLabelWidth, maxTestLabelHeight, { - x: maxTestLabelWidth + i * maxSnapshotLabelWidth, - y: maxSnapshotLabelHeight + j * maxTestLabelHeight + x: maxTestLabelWidth + padding + i * ( maxSnapshotLabelWidth + padding ), + y: maxSnapshotLabelHeight + padding + j * ( maxTestLabelHeight + padding ) } ); if ( test ) { @@ -131,11 +133,11 @@ reportProperty.link( report => { testLabels.forEach( ( label, i ) => { label.left = 0; - label.top = i * maxTestLabelHeight + maxSnapshotLabelHeight; + label.top = i * ( maxTestLabelHeight + padding ) + maxSnapshotLabelHeight + padding; } ); snapshotLabels.forEach( ( label, i ) => { label.top = 0; - label.left = maxTestLabelWidth + i * maxSnapshotLabelWidth; + label.left = ( maxTestLabelWidth + padding ) + i * ( maxSnapshotLabelWidth + padding ); } ); reportNode.children = [ diff --git a/js/local-server.js b/js/local-server.js index 350b072..56e2b72 100644 --- a/js/local-server.js +++ b/js/local-server.js @@ -25,7 +25,7 @@ const winston = require( 'winston' ); const PORT = 45366; const NUMBER_OF_DAYS_TO_KEEP_SNAPSHOTS = 2; // in days, any shapshots that are older will be removed from the continuous report -const DEBUG_PRETEND_CLEAN = true; +const DEBUG_PRETEND_CLEAN = false; const jsonHeaders = { 'Content-Type': 'application/json',