commit/galaxy-central: carlfeberhard: QA, qunit: update HDA, history contents tests
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/bdfef8f7d523/ Changeset: bdfef8f7d523 User: carlfeberhard Date: 2014-08-12 18:48:28 Summary: QA, qunit: update HDA, history contents tests Affected #: 2 files diff -r f926988f8e0a480c09d3462002f482b5ac806682 -r bdfef8f7d52336fbcd8b72ac06c37224ef9b87f5 test/qunit/tests/hda-base.js --- a/test/qunit/tests/hda-base.js +++ b/test/qunit/tests/hda-base.js @@ -1,14 +1,13 @@ // This file isn't really testing anything useful yet, it is just testing // (or demonstrating) qunit+backbone interactions. define([ - "mvc/dataset/hda-model", - "mvc/dataset/hda-base", + "mvc/history/hda-model", + "mvc/history/hda-li", "jquery", - "sinon-qunit", - "utils/localization" + "sinon-qunit" ], function( - hdaModel, - hdaBase, + HDA_MODEL, + HDA_BASE, $, sinon ){ @@ -18,10 +17,10 @@ module( "HDA base backbone view tests" ); test( "Base HDA view default construction, initialize", function() { - var hda = new hdaModel.HistoryDatasetAssociation({ + var hda = new HDA_MODEL.HistoryDatasetAssociation({ id : '123' }), - view = new hdaBase.HDABaseView({ model: hda }); + view = new HDA_BASE.HDAListItemView({ model: hda }); strictEqual( view.model, hda ); @@ -30,6 +29,6 @@ equal( view.selected, false ); equal( view.expanded, false ); equal( view.draggable, false ); - equal( view.id(), 'hda-123' ); + equal( view.id(), 'dataset-123' ); }); }); diff -r f926988f8e0a480c09d3462002f482b5ac806682 -r bdfef8f7d52336fbcd8b72ac06c37224ef9b87f5 test/qunit/tests/history_contents_model_tests.js --- a/test/qunit/tests/history_contents_model_tests.js +++ b/test/qunit/tests/history_contents_model_tests.js @@ -1,46 +1,45 @@ // This file isn't really testing anything useful yet, it is just testing // (or demonstrating) qunit+backbone interactions. define([ - "mvc/dataset/hda-model", + "mvc/history/hda-model", "jquery", "sinon-qunit" ], function( - hdaModel, + HDA_MODEL, $, sinon ){ module( "History Contents Model Tests" ); test( "HDA Constructions with Default Attributes", function() { - var hda = new hdaModel.HistoryDatasetAssociation(); - expect( 2 ); + var hda = new HDA_MODEL.HistoryDatasetAssociation({}); equal( hda.get( 'name' ), "(unnamed dataset)" ); equal( hda.get( 'state' ), "new" ); } ); test( "HDA Construction with Supplied Attributes", function() { - var hda = new hdaModel.HistoryDatasetAssociation( { - name: "my dataset", - state: "ok", - } ); - expect( 2 ); - + var hda = new HDA_MODEL.HistoryDatasetAssociation({ + history_content_type : 'dataset', + name: "my dataset", + state: "ok" + }); equal( hda.get( 'name' ), "my dataset" ); equal( hda.get( 'state' ), "ok" ); } ); test( "HDA Deletion", function() { - var hda = new hdaModel.HistoryDatasetAssociation( { - id: "hda1", - history_id: "h1", - deleted: false, - } ); - - // Demonstrate sinon stubbing out of Ajax queries... + var hda = new HDA_MODEL.HistoryDatasetAssociation({ + history_content_type : 'dataset', + id: "hda1", + history_id: "h1", + deleted: false + }); equal( hda.get( 'deleted' ), false ); sinon.stub( $, "ajax" ); - hda.delete(); + hda[ 'delete' ](); equal( hda.get( 'deleted' ), true ); - ok( $.ajax.calledWithMatch( { url: "/api/histories/h1/contents/hda1" } ) ); - } ); -} ); + // to get the url sinon used: + //console.debug( $.ajax.lastCall.args[0].url ) + ok( $.ajax.calledWithMatch( { url: "/api/histories/h1/contents/datasets/hda1" } ) ); + }); +}); Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org