mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Testing, qunit: remove unfortunately silent error of missing global Galaxy when running via require and phantom by checking scope first, update list of pairs tests with recent option changes, remove debugging cruft
This commit is contained in:
committed by
John Chilton
parent
87d8f5762a
commit
19d00d6ac6
@@ -92,7 +92,7 @@ var HistoryContentMixin = {
|
||||
//TODO: global
|
||||
//TODO: these are probably better done on the leaf classes
|
||||
/** history content goes through the 'api/histories' API */
|
||||
urlRoot: Galaxy.options.root + 'api/histories/',
|
||||
urlRoot: ( window.Galaxy? Galaxy.options.root : '/' ) + 'api/histories/',
|
||||
|
||||
/** full url spec. for this content */
|
||||
url : function(){
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"history-content-model.js","sources":["../../../src/mvc/history/history-content-model.js"],"names":["define","STATES","BASE_MVC","typeIdStr","type","id","join","HistoryContentMixin","defaults","history_id","history_content_type","hid","visible","idAttribute","constructor","attrs","type_id","this","debug","Backbone","Model","apply","arguments","_typeIdStr","get","initialize","on","_createTypeId","set","isNew","hidden","isVisible","show_deleted","show_hidden","urlRoot","Galaxy","options","root","url","hide","save","jQuery","when","unhide","toString","nameAndId","HistoryContent","extend","LoggableMixin"],"mappings":"AAAAA,QACI,qBACA,eACA,sBACD,SAAUC,EAAQC,GAGrB,GAAIC,GAAY,SAAqBC,EAAMC,GACvC,OAASD,EAAMC,GAAKC,KAAM,MAM1BC,GAIAC,UAEIC,WAAsB,KAEtBC,qBAAsB,KAEtBC,IAAsB,KAEtBC,SAAsB,GAQ1BC,YAAc,UAGdC,YAAc,SAAUC,GACpBA,EAAMC,QAAUb,EAAWY,EAAML,qBAAsBK,EAAMV,IAC7DY,KAAKC,MAAO,mCAAoCH,EAAMC,SACtDG,SAASC,MAAMC,MAAOJ,KAAMK,YAIhCC,WAAa,WACT,MAAOpB,GAAWc,KAAKO,IAAK,wBAA0BP,KAAKO,IAAK,QAIpEC,WAAa,WACTR,KAAKS,GAAI,YAAaT,KAAKU,gBAI/BA,cAAgB,WACZV,KAAKW,IAAK,UAAWX,KAAKM,eAM9BM,MAAQ,WACJ,OAAQZ,KAAKO,IAAK,OAKtBM,OAAS,WACL,OAAQb,KAAKO,IAAK,YAQtBO,UAAY,SAAUC,EAAcC,GAEhC,GAAIF,IAAY,CAShB,OAROC,KACDf,KAAKO,IAAK,aAAeP,KAAKO,IAAK,YACrCO,GAAY,GAETE,GACAhB,KAAKO,IAAK,aACbO,GAAY,GAETA,GAOXG,QAASC,OAAOC,QAAQC,KAAO,iBAG/BC,IAAM,WACF,GAAIA,GAAMrB,KAAKiB,QAAUjB,KAAKO,IAAK,cAAiB,aAC7CP,KAAKO,IAAI,wBAA0B,KAAOP,KAAKO,IAAK,KAC3D,OAAOc,IAIXC,KAAO,SAAUH,GACb,MAAKnB,MAAKO,IAAK,WACRP,KAAKuB,MAAQ5B,SAAS,GAASwB,GADDK,OAAOC,QAIhDC,OAAS,SAAUP,GACf,MAAInB,MAAKO,IAAK,WAAsBiB,OAAOC,OACpCzB,KAAKuB,MAAQ5B,SAAS,GAAQwB,IAKzCQ,SAAW,WACP,GAAIC,GAAY5B,KAAKO,IAAK,OAAU,EAIpC,OAHIP,MAAKO,IAAK,UACVqB,EAAY5B,KAAKO,IAAK,OAAU,MAAQP,KAAKO,IAAK,QAAW,KAAOqB,GAEjE,kBAAoBA,EAAY,MAS3CC,EAAiB3B,SAASC,MAAM2B,OAAQ7C,EAAS8C,eAAgBD,OAAQxC,EAIzE,QACIJ,UAAsBA,EACtBI,oBAAsBA,EACtBuC,eAAsBA"}
|
||||
{"version":3,"file":"history-content-model.js","sources":["../../../src/mvc/history/history-content-model.js"],"names":["define","STATES","BASE_MVC","typeIdStr","type","id","join","HistoryContentMixin","defaults","history_id","history_content_type","hid","visible","idAttribute","constructor","attrs","type_id","this","debug","Backbone","Model","apply","arguments","_typeIdStr","get","initialize","on","_createTypeId","set","isNew","hidden","isVisible","show_deleted","show_hidden","urlRoot","window","Galaxy","options","root","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,SAAW,WACP,GAAIC,GAAY7B,KAAKO,IAAK,OAAU,EAIpC,OAHIP,MAAKO,IAAK,UACVsB,EAAY7B,KAAKO,IAAK,OAAU,MAAQP,KAAKO,IAAK,QAAW,KAAOsB,GAEjE,kBAAoBA,EAAY,MAS3CC,EAAiB5B,SAASC,MAAM4B,OAAQ9C,EAAS+C,eAAgBD,OAAQzC,EAIzE,QACIJ,UAAsBA,EACtBI,oBAAsBA,EACtBwC,eAAsBA"}
|
||||
@@ -1,2 +1,2 @@
|
||||
define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b){var c=function(a,b){return[a,b].join("-")},d={defaults:{history_id:null,history_content_type:null,hid:null,visible:!0},idAttribute:"type_id",constructor:function(a){a.type_id=c(a.history_content_type,a.id),this.debug("HistoryContentMixin.constructor:",a.type_id),Backbone.Model.apply(this,arguments)},_typeIdStr:function(){return c(this.get("history_content_type"),this.get("id"))},initialize:function(){this.on("change:id",this._createTypeId)},_createTypeId:function(){this.set("type_id",this._typeIdStr())},isNew:function(){return!this.get("id")},hidden:function(){return!this.get("visible")},isVisible:function(a,b){var c=!0;return a||!this.get("deleted")&&!this.get("purged")||(c=!1),b||this.get("visible")||(c=!1),c},urlRoot:Galaxy.options.root+"api/histories/",url:function(){var a=this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id");return a},hide:function(a){return this.get("visible")?this.save({visible:!1},a):jQuery.when()},unhide:function(a){return this.get("visible")?jQuery.when():this.save({visible:!0},a)},toString:function(){var a=this.get("id")||"";return this.get("name")&&(a=this.get("hid")+' :"'+this.get("name")+'",'+a),"HistoryContent("+a+")"}},e=Backbone.Model.extend(b.LoggableMixin).extend(d);return{typeIdStr:c,HistoryContentMixin:d,HistoryContent:e}});
|
||||
define(["mvc/dataset/states","mvc/base-mvc","utils/localization"],function(a,b){var c=function(a,b){return[a,b].join("-")},d={defaults:{history_id:null,history_content_type:null,hid:null,visible:!0},idAttribute:"type_id",constructor:function(a){a.type_id=c(a.history_content_type,a.id),this.debug("HistoryContentMixin.constructor:",a.type_id),Backbone.Model.apply(this,arguments)},_typeIdStr:function(){return c(this.get("history_content_type"),this.get("id"))},initialize:function(){this.on("change:id",this._createTypeId)},_createTypeId:function(){this.set("type_id",this._typeIdStr())},isNew:function(){return!this.get("id")},hidden:function(){return!this.get("visible")},isVisible:function(a,b){var c=!0;return a||!this.get("deleted")&&!this.get("purged")||(c=!1),b||this.get("visible")||(c=!1),c},urlRoot:(window.Galaxy?Galaxy.options.root:"/")+"api/histories/",url:function(){var a=this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id");return a},hide:function(a){return this.get("visible")?this.save({visible:!1},a):jQuery.when()},unhide:function(a){return this.get("visible")?jQuery.when():this.save({visible:!0},a)},toString:function(){var a=this.get("id")||"";return this.get("name")&&(a=this.get("hid")+' :"'+this.get("name")+'",'+a),"HistoryContent("+a+")"}},e=Backbone.Model.extend(b.LoggableMixin).extend(d);return{typeIdStr:c,HistoryContentMixin:d,HistoryContent:e}});
|
||||
//# sourceMappingURL=../../../maps/mvc/history/history-content-model.js.map
|
||||
@@ -13,7 +13,6 @@ define([
|
||||
){
|
||||
/*globals equal test module expect deepEqual strictEqual */
|
||||
"use strict";
|
||||
|
||||
module( "HDA base backbone view tests" );
|
||||
|
||||
test( "Base HDA view default construction, initialize", function() {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// (or demonstrating) qunit+backbone interactions.
|
||||
define([
|
||||
"mvc/history/hda-model",
|
||||
|
||||
"jquery",
|
||||
"sinon-qunit"
|
||||
], function(
|
||||
|
||||
@@ -4,8 +4,6 @@ define([
|
||||
"sinon-qunit",
|
||||
'test-data/job-dag-1'
|
||||
], function( JobDAG, $, sinon, testData ){
|
||||
console.debug( '' );
|
||||
|
||||
/*globals equal ok, test module expect deepEqual strictEqual */
|
||||
"use strict";
|
||||
|
||||
|
||||
@@ -66,7 +66,6 @@ define([
|
||||
};
|
||||
|
||||
module( "Metrics logger tests" );
|
||||
console.debug( '\n' );
|
||||
// ======================================================================== MetricsLogger
|
||||
test( "logger construction/initializiation defaults", function() {
|
||||
var logger = new metrics.MetricsLogger({});
|
||||
@@ -177,7 +176,7 @@ define([
|
||||
logger.emit( 'metric', 'test', [ 1, 2, { three: 3 }] );
|
||||
logger._postCache();
|
||||
server.respond();
|
||||
|
||||
|
||||
ok( callback.calledOnce, 'onServerResponse was called' );
|
||||
equal( logger.cache.length(), 0, 'should have emptied cache (on success)' );
|
||||
equal( logger._postSize, 1000, '_postSize still at default' );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
define([
|
||||
"mvc/collection/paired-collection-creator",
|
||||
"mvc/collection/list-of-pairs-collection-creator",
|
||||
"test-data/paired-collection-creator.data",
|
||||
"jquery",
|
||||
"sinon-qunit"
|
||||
@@ -19,11 +19,10 @@ define([
|
||||
test( "Creator base/empty construction/initializiation defaults", function() {
|
||||
var pcc = new PCC([]);
|
||||
ok( pcc instanceof PCC );
|
||||
ok( pcc.hasOwnProperty( 'options' ) && typeof pcc.options === 'object' );
|
||||
deepEqual( pcc.options.filters, pcc.DEFAULT_FILTERS );
|
||||
ok( pcc.options.automaticallyPair );
|
||||
equal( pcc.options.matchPercentage, 0.9 );
|
||||
equal( pcc.options.strategy, 'lcs' );
|
||||
deepEqual( pcc.filters, pcc.commonFilters[ pcc.DEFAULT_FILTERS ] );
|
||||
ok( pcc.automaticallyPair );
|
||||
equal( pcc.matchPercentage, 0.9 );
|
||||
equal( pcc.strategy, 'autopairLCS' );
|
||||
});
|
||||
|
||||
test( "Creator construction/initializiation with datasets", function() {
|
||||
|
||||
Reference in New Issue
Block a user