Skip to content

Commit

Permalink
Merge pull request #1065 from jmchilton/test_fix_3
Browse files Browse the repository at this point in the history
[15.10] Testing: update casperjs functional tests; change expected size strin…
  • Loading branch information
bgruening committed Nov 12, 2015
2 parents 3a78d9d + 559c89a commit a3034ab
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion test/casperjs/anon-history-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spaceghost.test.begin( 'Testing histories for anonymous users', 0, function suit
this.test.assertVisible( nameSelector, 'History name is visible' );
this.test.assertSelectorHasText( nameSelector, unnamedName, 'History name is ' + unnamedName );

this.test.comment( "history should display size and size should be 0 bytes" );
this.test.comment( "history should display size and size should be " + initialSizeStr );
this.test.assertExists( sizeSelector, 'Found ' + sizeSelector );
this.test.assertVisible( sizeSelector, 'History size is visible' );
this.test.assertSelectorHasText( sizeSelector, initialSizeStr,
Expand Down
2 changes: 1 addition & 1 deletion test/casperjs/api-hda-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ spaceghost.test.begin( 'Test the HDA API', 0, function suite( test ){
//this.test.comment( 'update should sanitize any new name' );

this.test.comment( 'update should allow unicode in names' );
var unicodeName = 'Ржевский сапоги';
var unicodeName = 'ржевский сапоги';
returned = this.api.hdas.update( lastHistory.id, firstHda.id, {
name : unicodeName
});
Expand Down
2 changes: 1 addition & 1 deletion test/casperjs/api-history-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spaceghost.openHomePage().then( function(){
var historyShow = this.api.histories.show( firstHistory.id );
//this.debug( this.jsonStr( historyShow ) );
this.test.assert( this.hasKeys( historyShow, [
'id', 'name', 'annotation', 'nice_size', 'contents_url',
'id', 'name', 'annotation', 'size', 'contents_url',
'state', 'state_details', 'state_ids' ]),
'Has the proper keys' );

Expand Down
4 changes: 2 additions & 2 deletions test/casperjs/hda-state-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ spaceghost.test.begin( 'Test the form of various HDA states', 0, function suite(
// different states, datatypes will have different action buttons
testIconButton.call( this, hdaDbId, buttonsSelector, 'info',
this.historypanel.data.hdaPrimaryActionButtons.info );
testIconButton.call( this, hdaDbId, buttonsSelector, 'rerun',
this.historypanel.data.hdaPrimaryActionButtons.rerun );
// testIconButton.call( this, hdaDbId, buttonsSelector, 'rerun',
// this.historypanel.data.hdaPrimaryActionButtons.rerun );

//TODO: move to testDownloadButton as its own step
if( !expectedMetadataFiles ){
Expand Down
11 changes: 6 additions & 5 deletions test/casperjs/history-panel-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ spaceghost.test.begin( 'Testing the form of the main/current history panel', 0,
annoIconSelector = spaceghost.historypanel.data.selectors.history.annoIcon,
emptyMsgSelector = spaceghost.historypanel.data.selectors.history.emptyMsg,
emptyMsgStr = spaceghost.historypanel.data.text.history.emptyMsg,
tagAreaSelector = spaceghost.historypanel.data.selectors.history.tagArea,
annoAreaSelector = spaceghost.historypanel.data.selectors.history.annoArea,
tagAreaSelector = spaceghost.historypanel.data.selectors.history.tagArea,
annoAreaSelector = spaceghost.historypanel.data.selectors.history.annoArea,
nameTooltip = spaceghost.historypanel.data.text.history.tooltips.name,

refreshButtonSelector = 'a#history-refresh-button',
refreshButtonIconSelector = 'span.fa-refresh';
refreshButtonIconSelector = 'span.fa-refresh',
bytesString = 'b';

// local
var newHistoryName = "Test History",
Expand Down Expand Up @@ -145,8 +146,8 @@ spaceghost.test.begin( 'Testing the form of the main/current history panel', 0,
this.test.assertSelectorHasText( nameSelector, newHistoryName, 'History name is ' + newHistoryName );

var onetxtFilesize = require( 'fs' ).size( filepathToUpload ),
expectedSize = onetxtFilesize + ' bytes';
this.test.comment( "history should display size and size should be " + onetxtFilesize + " bytes" );
expectedSize = onetxtFilesize + ' ' + bytesString;
this.test.comment( "history should display size and size should be " + onetxtFilesize + " " + bytesString );
this.test.assertExists( sizeSelector, 'Found ' + sizeSelector );
this.test.assertVisible( sizeSelector, 'History size is visible' );
this.test.assertSelectorHasText( sizeSelector, expectedSize,
Expand Down
2 changes: 1 addition & 1 deletion test/casperjs/modules/historypanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ HistoryPanel.prototype.data = {
annoIcon : 'Edit history annotation'
},
newName : 'Unnamed history',
newSize : '0 bytes',
newSize : '0 b',
emptyMsg : "This history is empty. You can load your own data or get data from an external source"
},
hda : {
Expand Down

0 comments on commit a3034ab

Please sign in to comment.