1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

enable named views for smoke tests

This commit is contained in:
Keivan Beigi 2015-02-04 11:09:34 -08:00
parent 327802fae4
commit c1467d0ecd
3 changed files with 11 additions and 4 deletions

View File

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

View File

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

View File

@ -8,8 +8,8 @@ var asNamedView = require('../Mixins/AsNamedView');
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;