1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2025-02-24 07:01:29 +00: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 @@ namespace NzbDrone.Automation.Test
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(){
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;