enable named views for smoke tests

pull/3113/head
Keivan Beigi 10 years ago
parent 327802fae4
commit c1467d0ecd

@ -45,6 +45,8 @@ namespace NzbDrone.Automation.Test
var page = new PageBase(driver); var page = new PageBase(driver);
page.WaitForNoSpinner(); page.WaitForNoSpinner();
driver.ExecuteScript("window.NzbDrone.NameViews = true;");
GetPageErrors().Should().BeEmpty(); GetPageErrors().Should().BeEmpty();
} }

@ -1,5 +1,7 @@
module.exports = function(){ module.exports = function(){
window.NzbDrone.NameViews = window.NzbDrone.NameViews || !window.NzbDrone.Production;
var regex = new RegExp('/', 'g'); var regex = new RegExp('/', 'g');
var _getViewName = function(template){ var _getViewName = function(template){
@ -11,7 +13,10 @@ module.exports = function(){
var originalOnRender = this.onRender; var originalOnRender = this.onRender;
this.onRender = function(){ this.onRender = function(){
if(window.NzbDrone.NameViews) {
this.$el.addClass('iv-' + _getViewName(this.template)); this.$el.addClass('iv-' + _getViewName(this.template));
}
if(originalOnRender) { if(originalOnRender) {
return originalOnRender.call(this); return originalOnRender.call(this);

@ -8,8 +8,8 @@ var asNamedView = require('../Mixins/AsNamedView');
templateMixin.call(window.Marionette.TemplateCache); templateMixin.call(window.Marionette.TemplateCache);
if(!window.NzbDrone.Production) {
asNamedView.call(window.Marionette.ItemView.prototype); asNamedView.call(window.Marionette.ItemView.prototype);
}
module.exports = window.Marionette; module.exports = window.Marionette;
Loading…
Cancel
Save