Skip to content

Commit

Permalink
A few fixes/improvements to CT tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Apr 15, 2020
1 parent b90840f commit 4a3f3a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions js/local-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
} ) );
Expand All @@ -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 ) {
Expand All @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion js/local-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 4a3f3a3

Please sign in to comment.