couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [23/27] fauxton commit: updated refs/heads/master to 0ca35da
Date Tue, 31 May 2016 07:58:51 GMT
http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/stores.js
----------------------------------------------------------------------
diff --git a/app/addons/components/stores.js b/app/addons/components/stores.js
index 916d6ea..af5a69c 100644
--- a/app/addons/components/stores.js
+++ b/app/addons/components/stores.js
@@ -10,126 +10,120 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-   '../../core/api',
-  '../../app',
-  './actiontypes'
-],
-
-function (FauxtonAPI, app, ActionTypes) {
-  var Stores = {};
-
-  Stores.ComponentStore = FauxtonAPI.Store.extend({
-    initialize: function () {
-      this.reset();
-    },
-
-    reset: function () {
-      this._apiBarVisible = false;
-      this._apiBarButtonVisible = true;
-      this._endpoint = '';
-      this._docURL = FauxtonAPI.constants.DOC_URLS.GENERAL;
-    },
-
-    updateAPIBar: function (settings) {
-      this._apiBarVisible = settings.contentVisible;
-      this._apiBarButtonVisible = settings.buttonVisible;
-      this._endpoint = settings.endpoint;
-      this._docURL = settings.docURL;
-    },
-
-    setVisibleButton: function (state) {
-      this._apiBarButtonVisible = state;
-    },
-
-    setApiBarVisible: function (state) {
-      this._apiBarVisible = state;
-    },
-
-    getEndpoint: function () {
-      return this._endpoint;
-    },
-
-    getDocURL: function () {
-      return this._docURL;
-    },
-
-    getIsAPIBarButtonVisible: function () {
-      return this._apiBarButtonVisible;
-    },
-
-    getIsAPIBarVisible: function () {
-      return this._apiBarVisible;
-    },
-
-    dispatch: function (action) {
-      switch (action.type) {
-        case ActionTypes.CMPNTS_SHOW_API_BAR_BUTTON:
-          this.setVisibleButton(true);
-        break;
-
-        case ActionTypes.CMPNTS_HIDE_API_BAR_BUTTON:
-          this.setVisibleButton(false);
-        break;
-
-        case ActionTypes.CMPNTS_SET_API_BAR_CONTENT_VISIBLE_STATE:
-          this.setApiBarVisible(action.options);
-        break;
-
-        case ActionTypes.CMPNTS_UPDATE_API_BAR:
-          this.updateAPIBar(action.options);
-        break;
-
-        default:
-        return;
-          // do nothing
-      }
-
-      this.triggerChange();
+import FauxtonAPI from "../../core/api";
+import app from "../../app";
+import ActionTypes from "./actiontypes";
+var Stores = {};
+
+Stores.ComponentStore = FauxtonAPI.Store.extend({
+  initialize: function () {
+    this.reset();
+  },
+
+  reset: function () {
+    this._apiBarVisible = false;
+    this._apiBarButtonVisible = true;
+    this._endpoint = '';
+    this._docURL = FauxtonAPI.constants.DOC_URLS.GENERAL;
+  },
+
+  updateAPIBar: function (settings) {
+    this._apiBarVisible = settings.contentVisible;
+    this._apiBarButtonVisible = settings.buttonVisible;
+    this._endpoint = settings.endpoint;
+    this._docURL = settings.docURL;
+  },
+
+  setVisibleButton: function (state) {
+    this._apiBarButtonVisible = state;
+  },
+
+  setApiBarVisible: function (state) {
+    this._apiBarVisible = state;
+  },
+
+  getEndpoint: function () {
+    return this._endpoint;
+  },
+
+  getDocURL: function () {
+    return this._docURL;
+  },
+
+  getIsAPIBarButtonVisible: function () {
+    return this._apiBarButtonVisible;
+  },
+
+  getIsAPIBarVisible: function () {
+    return this._apiBarVisible;
+  },
+
+  dispatch: function (action) {
+    switch (action.type) {
+      case ActionTypes.CMPNTS_SHOW_API_BAR_BUTTON:
+        this.setVisibleButton(true);
+      break;
+
+      case ActionTypes.CMPNTS_HIDE_API_BAR_BUTTON:
+        this.setVisibleButton(false);
+      break;
+
+      case ActionTypes.CMPNTS_SET_API_BAR_CONTENT_VISIBLE_STATE:
+        this.setApiBarVisible(action.options);
+      break;
+
+      case ActionTypes.CMPNTS_UPDATE_API_BAR:
+        this.updateAPIBar(action.options);
+      break;
+
+      default:
+      return;
+        // do nothing
     }
-  });
 
-  Stores.DeleteDbModalStore = FauxtonAPI.Store.extend({
-    initialize: function () {
-      this.reset();
-    },
+    this.triggerChange();
+  }
+});
 
-    reset: function () {
-      this._deleteModal = {showDeleteModal: false, dbId: '', isSystemDatabase: false};
-    },
+Stores.DeleteDbModalStore = FauxtonAPI.Store.extend({
+  initialize: function () {
+    this.reset();
+  },
 
-    setDeleteModal: function (options) {
-      options.isSystemDatabase = app.utils.isSystemDatabase(options.dbId);
-      this._deleteModal = options;
-    },
+  reset: function () {
+    this._deleteModal = {showDeleteModal: false, dbId: '', isSystemDatabase: false};
+  },
 
-    getShowDeleteDatabaseModal: function () {
-      return this._deleteModal;
-    },
+  setDeleteModal: function (options) {
+    options.isSystemDatabase = app.utils.isSystemDatabase(options.dbId);
+    this._deleteModal = options;
+  },
 
-    dispatch: function (action) {
-      switch (action.type) {
-        case ActionTypes.CMPNTS_DATABASES_SHOWDELETE_MODAL:
-          this.setDeleteModal(action.options);
-        break;
+  getShowDeleteDatabaseModal: function () {
+    return this._deleteModal;
+  },
 
-        default:
-        return;
-      }
+  dispatch: function (action) {
+    switch (action.type) {
+      case ActionTypes.CMPNTS_DATABASES_SHOWDELETE_MODAL:
+        this.setDeleteModal(action.options);
+      break;
 
-      this.triggerChange();
+      default:
+      return;
     }
-  });
 
+    this.triggerChange();
+  }
+});
 
 
 
-  Stores.deleteDbModalStore = new Stores.DeleteDbModalStore();
-  Stores.deleteDbModalStore.dispatchToken = FauxtonAPI.dispatcher.register(Stores.deleteDbModalStore.dispatch);
 
-  Stores.componentStore = new Stores.ComponentStore();
-  Stores.componentStore.dispatchToken = FauxtonAPI.dispatcher.register(Stores.componentStore.dispatch);
+Stores.deleteDbModalStore = new Stores.DeleteDbModalStore();
+Stores.deleteDbModalStore.dispatchToken = FauxtonAPI.dispatcher.register(Stores.deleteDbModalStore.dispatch);
 
-  return Stores;
+Stores.componentStore = new Stores.ComponentStore();
+Stores.componentStore.dispatchToken = FauxtonAPI.dispatcher.register(Stores.componentStore.dispatch);
 
-});
+export default Stores;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/apiBarControllerSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/apiBarControllerSpec.react.jsx b/app/addons/components/tests/apiBarControllerSpec.react.jsx
index 36a639b..edb016c 100644
--- a/app/addons/components/tests/apiBarControllerSpec.react.jsx
+++ b/app/addons/components/tests/apiBarControllerSpec.react.jsx
@@ -9,171 +9,168 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../actions',
-  '../stores',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react-addons-test-utils',
-  'sinon',
-  'react',
-  'react-dom'
-], function (FauxtonAPI, Actions, Stores, ReactComponents, utils, TestUtils, sinon, React, ReactDOM) {
-
-  var assert = utils.assert;
-  var componentStore = Stores.componentStore;
-  var ApiBarController = ReactComponents.ApiBarController;
-
-
-  describe('ApiBarController', function () {
-    var container;
-
-    beforeEach(function () {
-      container = document.createElement('div');
-    });
+import FauxtonAPI from "../../../core/api";
+import Actions from "../actions";
+import Stores from "../stores";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
+import React from "react";
+import ReactDOM from "react-dom";
+
+var assert = utils.assert;
+var componentStore = Stores.componentStore;
+var ApiBarController = ReactComponents.ApiBarController;
+
+
+describe('ApiBarController', function () {
+  var container;
+
+  beforeEach(function () {
+    container = document.createElement('div');
+  });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-      componentStore.reset();
-    });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+    componentStore.reset();
+  });
 
-    it('Doesn\'t show up when explicitly set to visible false', function () {
-      var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
-      Actions.updateAPIBar({
-        buttonVisible: false,
-        endpoint: 'http://link.example.com',
-        docURL: 'http://link.example.com',
-        contentVisible: false
-      });
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 0);
+  it('Doesn\'t show up when explicitly set to visible false', function () {
+    var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
+    Actions.updateAPIBar({
+      buttonVisible: false,
+      endpoint: 'http://link.example.com',
+      docURL: 'http://link.example.com',
+      contentVisible: false
     });
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 0);
+  });
 
-    it('Shows up when set to visible', function () {
-      var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: 'http://link.example.com',
-        docURL: 'http://link.example.com',
-        contentVisible: false
-      });
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 1);
+  it('Shows up when set to visible', function () {
+    var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: 'http://link.example.com',
+      docURL: 'http://link.example.com',
+      contentVisible: false
     });
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 1);
+  });
 
-    it('Doesn\'t show up when set to visible BUT there\'s no endpoint defined', function () {
-      var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: '',
-        docURL: 'http://link.example.com',
-        contentVisible: false
-      });
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 0);
+  it('Doesn\'t show up when set to visible BUT there\'s no endpoint defined', function () {
+    var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: '',
+      docURL: 'http://link.example.com',
+      contentVisible: false
     });
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 0);
+  });
 
-    it('Confirm hide/show actions update component', function () {
-      var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
+  it('Confirm hide/show actions update component', function () {
+    var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
 
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: 'http://rocko.example.com',
-        docURL: 'http://link.example.com',
-        contentVisible: false
-      });
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: 'http://rocko.example.com',
+      docURL: 'http://link.example.com',
+      contentVisible: false
+    });
 
-      Actions.showAPIBarButton();
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 1, 'showAPIBarButton');
+    Actions.showAPIBarButton();
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 1, 'showAPIBarButton');
 
-      Actions.hideAPIBarButton();
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 0, 'hideAPIBarButton');
+    Actions.hideAPIBarButton();
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url').length, 0, 'hideAPIBarButton');
+  });
+
+  it('Confirm doc link icon appears when docURL set', function () {
+    var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: 'http://rocko.example.com',
+      docURL: 'http://doc.example.com',
+      contentVisible: false
     });
 
-    it('Confirm doc link icon appears when docURL set', function () {
-      var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: 'http://rocko.example.com',
-        docURL: 'http://doc.example.com',
-        contentVisible: false
-      });
-
-      TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.help-link').length, 1);
+    TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.help-link').length, 1);
+  });
+
+  it('Confirm doc link icon doesn\'t appear with no docURL', function () {
+    var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: 'http://rocko.example.com',
+      docURL: null,
+      contentVisible: false
     });
 
-    it('Confirm doc link icon doesn\'t appear with no docURL', function () {
-      var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: 'http://rocko.example.com',
-        docURL: null,
-        contentVisible: false
-      });
-
-      TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.help-link').length, 0);
+    TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.help-link').length, 0);
+  });
+
+  it('Confirm endpoint appears in markup', function () {
+    var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
+    var link = 'http://booyah.example.com';
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: link,
+      docURL: null,
+      contentVisible: false
     });
 
-    it('Confirm endpoint appears in markup', function () {
-      var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
-      var link = 'http://booyah.example.com';
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: link,
-        docURL: null,
-        contentVisible: false
-      });
-
-      TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.text-field-to-copy').val(), link);
+    TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.text-field-to-copy').val(), link);
+  });
+
+  it('Confirm endpoint is updated in markup', function () {
+    var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
+    var link = 'http://booyah.example.com';
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: link,
+      docURL: null,
+      contentVisible: false
     });
 
-    it('Confirm endpoint is updated in markup', function () {
-      var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
-      var link = 'http://booyah.example.com';
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: link,
-        docURL: null,
-        contentVisible: false
-      });
-
-      TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.text-field-to-copy').val(), link);
-
-      var newLink = 'http://chickensarenoisy.example.com';
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: newLink,
-        docURL: null,
-        contentVisible: true
-      });
-
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.text-field-to-copy').val(), newLink);
+    TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.text-field-to-copy').val(), link);
+
+    var newLink = 'http://chickensarenoisy.example.com';
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: newLink,
+      docURL: null,
+      contentVisible: true
     });
 
-    it('Confirm doc URL is updated in markup after a change', function () {
-      var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
-      var docLink = 'http://mydoc.example.com';
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: 'http://whatever.example.com',
-        docURL: docLink,
-        contentVisible: false
-      });
-
-      TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.help-link').attr('href'), docLink);
-
-      var newDocLink = 'http://newawesomedoclink.example.com';
-      Actions.updateAPIBar({
-        buttonVisible: true,
-        endpoint: 'http://whatever.example.com',
-        docURL: newDocLink,
-        contentVisible: true
-      });
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.help-link').attr('href'), newDocLink);
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.text-field-to-copy').val(), newLink);
+  });
+
+  it('Confirm doc URL is updated in markup after a change', function () {
+    var el = TestUtils.renderIntoDocument(<ApiBarController />, container);
+    var docLink = 'http://mydoc.example.com';
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: 'http://whatever.example.com',
+      docURL: docLink,
+      contentVisible: false
     });
 
+    TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.control-toggle-api-url')[0]);
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.help-link').attr('href'), docLink);
+
+    var newDocLink = 'http://newawesomedoclink.example.com';
+    Actions.updateAPIBar({
+      buttonVisible: true,
+      endpoint: 'http://whatever.example.com',
+      docURL: newDocLink,
+      contentVisible: true
+    });
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.help-link').attr('href'), newDocLink);
   });
+
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/badgesSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/badgesSpec.react.jsx b/app/addons/components/tests/badgesSpec.react.jsx
index 5504cc1..23cf3ef 100644
--- a/app/addons/components/tests/badgesSpec.react.jsx
+++ b/app/addons/components/tests/badgesSpec.react.jsx
@@ -9,48 +9,45 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils) {
-
-  var assert = utils.assert;
-
-  describe('Badges', function () {
-    var container, instance;
-    beforeEach(function () {
-      container = document.createElement('div');
-    });
-
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(instance).parentNode);
-    });
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+
+var assert = utils.assert;
+
+describe('Badges', function () {
+  var container, instance;
+  beforeEach(function () {
+    container = document.createElement('div');
+  });
 
-    it('renders a list of badges', function () {
-      instance = TestUtils.renderIntoDocument(
-        <ReactComponents.BadgeList elements={['foo', 'bar']} removeBadge={function () {}} />,
-        container
-      );
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(instance).parentNode);
+  });
 
-      var $el = $(ReactDOM.findDOMNode(instance));
+  it('renders a list of badges', function () {
+    instance = TestUtils.renderIntoDocument(
+      <ReactComponents.BadgeList elements={['foo', 'bar']} removeBadge={function () {}} />,
+      container
+    );
 
-      assert.equal($el.find('.component-badge').length, 2);
-    });
+    var $el = $(ReactDOM.findDOMNode(instance));
 
-    it('supports custom label formatters', function () {
-      instance = TestUtils.renderIntoDocument(
-        <ReactComponents.BadgeList elements={['foo', 'bar']} removeBadge={function () {}} getLabel={function (el) { return el + 'foo'; }} />,
-        container
-      );
+    assert.equal($el.find('.component-badge').length, 2);
+  });
 
-      var $el = $(ReactDOM.findDOMNode(instance));
+  it('supports custom label formatters', function () {
+    instance = TestUtils.renderIntoDocument(
+      <ReactComponents.BadgeList elements={['foo', 'bar']} removeBadge={function () {}} getLabel={function (el) { return el + 'foo'; }} />,
+      container
+    );
 
-      assert.equal($el.find('.component-badge').text(), 'foofoo×barfoo×');
-    });
+    var $el = $(ReactDOM.findDOMNode(instance));
 
+    assert.equal($el.find('.component-badge').text(), 'foofoo×barfoo×');
   });
+
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/beautifySpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/beautifySpec.react.jsx b/app/addons/components/tests/beautifySpec.react.jsx
index ab48db6..7306b96 100644
--- a/app/addons/components/tests/beautifySpec.react.jsx
+++ b/app/addons/components/tests/beautifySpec.react.jsx
@@ -9,62 +9,59 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils, sinon) {
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
 
-  var assert = utils.assert;
+var assert = utils.assert;
 
-  describe('Beautify', function () {
-    var container, beautifyEl;
+describe('Beautify', function () {
+  var container, beautifyEl;
 
-    beforeEach(function () {
-      container = document.createElement('div');
-    });
+  beforeEach(function () {
+    container = document.createElement('div');
+  });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-    });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
 
-    it('should be empty for multi-lined code', function () {
-      var correctCode = 'function() {\n    console.log("hello");\n}';
-      beautifyEl = TestUtils.renderIntoDocument(
-        <ReactComponents.Beautify code={correctCode}/>,
-        container
-      );
-      assert.ok(_.isNull(ReactDOM.findDOMNode(beautifyEl)));
-    });
+  it('should be empty for multi-lined code', function () {
+    var correctCode = 'function() {\n    console.log("hello");\n}';
+    beautifyEl = TestUtils.renderIntoDocument(
+      <ReactComponents.Beautify code={correctCode}/>,
+      container
+    );
+    assert.ok(_.isNull(ReactDOM.findDOMNode(beautifyEl)));
+  });
 
-    it('should have button to beautify for single line code', function () {
-      var badCode = 'function () { console.log("hello"); }';
-      beautifyEl = TestUtils.renderIntoDocument(<ReactComponents.Beautify code={badCode}/>, container);
-      assert.ok($(ReactDOM.findDOMNode(beautifyEl)).hasClass('beautify'));
-    });
+  it('should have button to beautify for single line code', function () {
+    var badCode = 'function () { console.log("hello"); }';
+    beautifyEl = TestUtils.renderIntoDocument(<ReactComponents.Beautify code={badCode}/>, container);
+    assert.ok($(ReactDOM.findDOMNode(beautifyEl)).hasClass('beautify'));
+  });
 
-    it('on click beautifies code', function () {
-      var fixedCode;
-      var correctCode = 'function() {\n    console.log("hello");\n}';
+  it('on click beautifies code', function () {
+    var fixedCode;
+    var correctCode = 'function() {\n    console.log("hello");\n}';
 
-      var beautifiedCode = function (code) {
-        fixedCode = code;
-      };
+    var beautifiedCode = function (code) {
+      fixedCode = code;
+    };
 
-      beautifyEl = TestUtils.renderIntoDocument(
-        <ReactComponents.Beautify
-          beautifiedCode={beautifiedCode}
-          code={'function() { console.log("hello"); }'}
-          noOfLines={1}/>,
-        container
-      );
-      TestUtils.Simulate.click(ReactDOM.findDOMNode(beautifyEl));
-      assert.equal(fixedCode, correctCode);
+    beautifyEl = TestUtils.renderIntoDocument(
+      <ReactComponents.Beautify
+        beautifiedCode={beautifiedCode}
+        code={'function() { console.log("hello"); }'}
+        noOfLines={1}/>,
+      container
+    );
+    TestUtils.Simulate.click(ReactDOM.findDOMNode(beautifyEl));
+    assert.equal(fixedCode, correctCode);
 
-    });
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/codeEditorPanelSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/codeEditorPanelSpec.react.jsx b/app/addons/components/tests/codeEditorPanelSpec.react.jsx
index 7d76162..1b62151 100644
--- a/app/addons/components/tests/codeEditorPanelSpec.react.jsx
+++ b/app/addons/components/tests/codeEditorPanelSpec.react.jsx
@@ -9,81 +9,77 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils, sinon) {
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
 
-  var assert = utils.assert;
-  var codeNoNewlines = 'function (doc) {emit(doc._id, 1);}';
-  var code = 'function (doc) {\n  emit(doc._id, 1);\n}';
+var assert = utils.assert;
+var codeNoNewlines = 'function (doc) {emit(doc._id, 1);}';
+var code = 'function (doc) {\n  emit(doc._id, 1);\n}';
 
-  describe('CodeEditorPanel', function () {
+describe('CodeEditorPanel', function () {
 
-    describe('Doc icon', function () {
-      it('hidden by default', function () {
-        var container = document.createElement('div');
-        var codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditorPanel defaultCode={code} />,
-          container
-        );
-        assert.equal($(ReactDOM.findDOMNode(codeEditorEl)).find('.icon-question-sign').length, 0);
-      });
-      it('hidden by default', function () {
-        var container = document.createElement('div');
-        var codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditorPanel defaultCode={code} docLink="http://link.com" />,
-          container
-        );
-        assert.equal($(ReactDOM.findDOMNode(codeEditorEl)).find('.icon-question-sign').length, 1);
-      });
+  describe('Doc icon', function () {
+    it('hidden by default', function () {
+      var container = document.createElement('div');
+      var codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditorPanel defaultCode={code} />,
+        container
+      );
+      assert.equal($(ReactDOM.findDOMNode(codeEditorEl)).find('.icon-question-sign').length, 0);
     });
+    it('hidden by default', function () {
+      var container = document.createElement('div');
+      var codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditorPanel defaultCode={code} docLink="http://link.com" />,
+        container
+      );
+      assert.equal($(ReactDOM.findDOMNode(codeEditorEl)).find('.icon-question-sign').length, 1);
+    });
+  });
 
-    describe('Zen Mode', function () {
-      it('shows zen mode by default', function () {
-        var container = document.createElement('div');
-        var codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditorPanel defaultCode={code} />,
-          container
-        );
-        assert.equal($(ReactDOM.findDOMNode(codeEditorEl)).find('.zen-editor-icon').length, 1);
-      });
+  describe('Zen Mode', function () {
+    it('shows zen mode by default', function () {
+      var container = document.createElement('div');
+      var codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditorPanel defaultCode={code} />,
+        container
+      );
+      assert.equal($(ReactDOM.findDOMNode(codeEditorEl)).find('.zen-editor-icon').length, 1);
+    });
 
-      it('omits zen mode if explicitly turned off', function () {
-        var container = document.createElement('div');
-        var codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditor defaultCode={code} allowZenMode={false} />,
-          container
-        );
-        assert.equal($(ReactDOM.findDOMNode(codeEditorEl)).find('.zen-editor-icon').length, 0);
-      });
+    it('omits zen mode if explicitly turned off', function () {
+      var container = document.createElement('div');
+      var codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditor defaultCode={code} allowZenMode={false} />,
+        container
+      );
+      assert.equal($(ReactDOM.findDOMNode(codeEditorEl)).find('.zen-editor-icon').length, 0);
     });
+  });
 
-    describe('Beautify', function () {
-      it('confirm clicking beautify actually works within context of component', function () {
-        var container = document.createElement('div');
-        var codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditorPanel
-            defaultCode={codeNoNewlines}
-          />,
-          container
-        );
+  describe('Beautify', function () {
+    it('confirm clicking beautify actually works within context of component', function () {
+      var container = document.createElement('div');
+      var codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditorPanel
+          defaultCode={codeNoNewlines}
+        />,
+        container
+      );
 
-        // confirm there are no newlines in the code at this point
-        assert.equal(codeEditorEl.getValue().match(/\n/g), null);
+      // confirm there are no newlines in the code at this point
+      assert.equal(codeEditorEl.getValue().match(/\n/g), null);
 
-        TestUtils.Simulate.click($(ReactDOM.findDOMNode(codeEditorEl)).find('.beautify')[0]);
+      TestUtils.Simulate.click($(ReactDOM.findDOMNode(codeEditorEl)).find('.beautify')[0]);
 
-        // now confirm newlines are found
-        assert.equal(codeEditorEl.getValue().match(/\n/g).length, 2);
-      });
+      // now confirm newlines are found
+      assert.equal(codeEditorEl.getValue().match(/\n/g).length, 2);
     });
-
   });
 
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/codeEditorSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/codeEditorSpec.react.jsx b/app/addons/components/tests/codeEditorSpec.react.jsx
index 99c5d17..7f45057 100644
--- a/app/addons/components/tests/codeEditorSpec.react.jsx
+++ b/app/addons/components/tests/codeEditorSpec.react.jsx
@@ -9,106 +9,103 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils, sinon) {
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
 
-  var assert = utils.assert;
-  var code = 'function (doc) {\n  emit(doc._id, 1);\n}';
-  var code2 = 'function (doc) {\n if(doc._id) { \n emit(doc._id, 2); \n } \n}';
+var assert = utils.assert;
+var code = 'function (doc) {\n  emit(doc._id, 1);\n}';
+var code2 = 'function (doc) {\n if(doc._id) { \n emit(doc._id, 2); \n } \n}';
 
-  var ignorableErrors = [
-    'Missing name in function declaration.',
-    "['{a}'] is better written in dot notation."
-  ];
+var ignorableErrors = [
+  'Missing name in function declaration.',
+  "['{a}'] is better written in dot notation."
+];
 
-  describe('Code Editor', function () {
-    var container, codeEditorEl, spy;
+describe('Code Editor', function () {
+  var container, codeEditorEl, spy;
 
-    beforeEach(function () {
-      spy = sinon.spy();
-      container = document.createElement('div');
-      codeEditorEl = TestUtils.renderIntoDocument(
-        <ReactComponents.CodeEditor defaultCode={code} blur={spy} />,
-        container
-      );
-    });
-
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-    });
+  beforeEach(function () {
+    spy = sinon.spy();
+    container = document.createElement('div');
+    codeEditorEl = TestUtils.renderIntoDocument(
+      <ReactComponents.CodeEditor defaultCode={code} blur={spy} />,
+      container
+    );
+  });
 
-    describe('Tracking edits', function () {
-      it('no change on mount', function () {
-        assert.notOk(codeEditorEl.hasChanged());
-      });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
 
-      it('detects change on user input', function () {
-        codeEditorEl.editor.setValue(code2, -1);
-        assert.ok(codeEditorEl.hasChanged());
-      });
+  describe('Tracking edits', function () {
+    it('no change on mount', function () {
+      assert.notOk(codeEditorEl.hasChanged());
     });
 
-    describe('onBlur', function () {
-      it('calls blur function', function () {
-        codeEditorEl.editor._emit('blur');
-        assert.ok(spy.calledOnce);
-      });
+    it('detects change on user input', function () {
+      codeEditorEl.editor.setValue(code2, -1);
+      assert.ok(codeEditorEl.hasChanged());
     });
+  });
 
-    describe('setHeightToLineCount', function () {
-      it('check default num lines #1', function () {
-        codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditor code={code} setHeightToLineCount={true} />,
-          container
-        );
-        assert.ok(codeEditorEl.editor.getSession().getDocument().getLength(), 3);
-      });
-      it('check default num lines #2', function () {
-        codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditor code={code2} setHeightToLineCount={true} />,
-          container
-        );
-        assert.ok(codeEditorEl.editor.getSession().getDocument().getLength(), 5);
-      });
-      it('check maxLines', function () {
-        codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditor code={code2} setHeightToLineCount={true} maxLines={2} />,
-          container
-        );
-        assert.ok(codeEditorEl.editor.getSession().getDocument().getLength(), 2);
-      });
+  describe('onBlur', function () {
+    it('calls blur function', function () {
+      codeEditorEl.editor._emit('blur');
+      assert.ok(spy.calledOnce);
     });
+  });
 
-    describe('removeIncorrectAnnotations', function () {
-      beforeEach(function () {
-        codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditor defaultCode={code} ignorableErrors={ignorableErrors} />,
-          container
-        );
-      });
-      it('removes default errors that do not apply to CouchDB Views', function () {
-        assert.equal(codeEditorEl.getAnnotations(), 0);
-      });
+  describe('setHeightToLineCount', function () {
+    it('check default num lines #1', function () {
+      codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditor code={code} setHeightToLineCount={true} />,
+        container
+      );
+      assert.ok(codeEditorEl.editor.getSession().getDocument().getLength(), 3);
+    });
+    it('check default num lines #2', function () {
+      codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditor code={code2} setHeightToLineCount={true} />,
+        container
+      );
+      assert.ok(codeEditorEl.editor.getSession().getDocument().getLength(), 5);
     });
+    it('check maxLines', function () {
+      codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditor code={code2} setHeightToLineCount={true} maxLines={2} />,
+        container
+      );
+      assert.ok(codeEditorEl.editor.getSession().getDocument().getLength(), 2);
+    });
+  });
 
-    describe('getEditor', function () {
-      beforeEach(function () {
-        codeEditorEl = TestUtils.renderIntoDocument(
-          <ReactComponents.CodeEditor defaultCode={code} />,
-          container
-        );
-      });
-      it('returns a reference to get access to the editor', function () {
-        assert.ok(codeEditorEl.getEditor());
-      });
+  describe('removeIncorrectAnnotations', function () {
+    beforeEach(function () {
+      codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditor defaultCode={code} ignorableErrors={ignorableErrors} />,
+        container
+      );
     });
+    it('removes default errors that do not apply to CouchDB Views', function () {
+      assert.equal(codeEditorEl.getAnnotations(), 0);
+    });
+  });
 
+  describe('getEditor', function () {
+    beforeEach(function () {
+      codeEditorEl = TestUtils.renderIntoDocument(
+        <ReactComponents.CodeEditor defaultCode={code} />,
+        container
+      );
+    });
+    it('returns a reference to get access to the editor', function () {
+      assert.ok(codeEditorEl.getEditor());
+    });
   });
+
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/confirmButtonSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/confirmButtonSpec.react.jsx b/app/addons/components/tests/confirmButtonSpec.react.jsx
index 2bc9bbf..cc44b7c 100644
--- a/app/addons/components/tests/confirmButtonSpec.react.jsx
+++ b/app/addons/components/tests/confirmButtonSpec.react.jsx
@@ -9,63 +9,60 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils, sinon) {
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
 
-  var assert = utils.assert;
+var assert = utils.assert;
 
-  describe('ConfirmButton', function () {
-    var container, button;
-    beforeEach(function () {
-      container = document.createElement('div');
-    });
-
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-    });
+describe('ConfirmButton', function () {
+  var container, button;
+  beforeEach(function () {
+    container = document.createElement('div');
+  });
 
-    it('should render text properties', function () {
-      button = TestUtils.renderIntoDocument(
-        <ReactComponents.ConfirmButton text="Click here to render Rocko Artischocko" />,
-        container
-      );
-      assert.equal($(ReactDOM.findDOMNode(button)).text(), 'Click here to render Rocko Artischocko');
-    });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
 
-    it('should use onClick handler if provided', function () {
-      var spy = sinon.spy();
+  it('should render text properties', function () {
+    button = TestUtils.renderIntoDocument(
+      <ReactComponents.ConfirmButton text="Click here to render Rocko Artischocko" />,
+      container
+    );
+    assert.equal($(ReactDOM.findDOMNode(button)).text(), 'Click here to render Rocko Artischocko');
+  });
 
-      button = TestUtils.renderIntoDocument(
-        <ReactComponents.ConfirmButton text="Click here" onClick={spy} />,
-        container
-      );
+  it('should use onClick handler if provided', function () {
+    var spy = sinon.spy();
 
-      TestUtils.Simulate.click(ReactDOM.findDOMNode(button));
-      assert.ok(spy.calledOnce);
-    });
+    button = TestUtils.renderIntoDocument(
+      <ReactComponents.ConfirmButton text="Click here" onClick={spy} />,
+      container
+    );
 
-    it('shows icon by default', function () {
-      button = TestUtils.renderIntoDocument(
-        <ReactComponents.ConfirmButton text="Click here" onClick={function () { }} />,
-        container
-      );
-      assert.equal($(ReactDOM.findDOMNode(button)).find('.icon').length, 1);
-    });
+    TestUtils.Simulate.click(ReactDOM.findDOMNode(button));
+    assert.ok(spy.calledOnce);
+  });
 
-    it('optionally omits the icon', function () {
-      button = TestUtils.renderIntoDocument(
-        <ReactComponents.ConfirmButton text="Click here" onClick={function () { }} showIcon={false} />,
-        container
-      );
-      assert.equal($(ReactDOM.findDOMNode(button)).find('.icon').length, 0);
-    });
+  it('shows icon by default', function () {
+    button = TestUtils.renderIntoDocument(
+      <ReactComponents.ConfirmButton text="Click here" onClick={function () { }} />,
+      container
+    );
+    assert.equal($(ReactDOM.findDOMNode(button)).find('.icon').length, 1);
+  });
 
+  it('optionally omits the icon', function () {
+    button = TestUtils.renderIntoDocument(
+      <ReactComponents.ConfirmButton text="Click here" onClick={function () { }} showIcon={false} />,
+      container
+    );
+    assert.equal($(ReactDOM.findDOMNode(button)).find('.icon').length, 0);
   });
+
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/deleteDatabaseModalSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/deleteDatabaseModalSpec.react.jsx b/app/addons/components/tests/deleteDatabaseModalSpec.react.jsx
index 609bb43..32e6a52 100644
--- a/app/addons/components/tests/deleteDatabaseModalSpec.react.jsx
+++ b/app/addons/components/tests/deleteDatabaseModalSpec.react.jsx
@@ -9,70 +9,66 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react-bootstrap',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-], function (FauxtonAPI, ReactComponents, utils, ReactBootstrap, React, ReactDOM, TestUtils) {
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import { Modal } from "react-bootstrap";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
 
-  var assert = utils.assert;
-  var Modal = ReactBootstrap.Modal;
+var assert = utils.assert;
 
-  function noop () {}
+function noop () {}
 
-  describe('DeleteDatabaseModal', function () {
-    var container, instance;
-    beforeEach(function () {
-      container = document.createElement('div');
-    });
+describe('DeleteDatabaseModal', function () {
+  var container, instance;
+  beforeEach(function () {
+    container = document.createElement('div');
+  });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-    });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
 
-    it('submitting is disabled when initially rendered', function () {
-      instance = TestUtils.renderIntoDocument(
-        <ReactComponents.DeleteDatabaseModal
-          showHide={noop}
-          modalProps={{isSystemDatabase: false, showDeleteModal: true, dbId: 'fooo'}} />,
-        container
-      );
+  it('submitting is disabled when initially rendered', function () {
+    instance = TestUtils.renderIntoDocument(
+      <ReactComponents.DeleteDatabaseModal
+        showHide={noop}
+        modalProps={{isSystemDatabase: false, showDeleteModal: true, dbId: 'fooo'}} />,
+      container
+    );
 
-      assert.ok($('body').find('.modal').find('button.delete').prop('disabled'));
-    });
+    assert.ok($('body').find('.modal').find('button.delete').prop('disabled'));
+  });
 
-    it('submitting is disabled when garbage entered', function () {
-      instance = TestUtils.renderIntoDocument(
-        <ReactComponents.DeleteDatabaseModal
-          showHide={noop}
-          modalProps={{isSystemDatabase: false, showDeleteModal: true, dbId: 'fooo'}} />,
-        container
-      );
+  it('submitting is disabled when garbage entered', function () {
+    instance = TestUtils.renderIntoDocument(
+      <ReactComponents.DeleteDatabaseModal
+        showHide={noop}
+        modalProps={{isSystemDatabase: false, showDeleteModal: true, dbId: 'fooo'}} />,
+      container
+    );
 
-      var input = $('body').find('.modal').find('input')[0];
+    var input = $('body').find('.modal').find('input')[0];
 
-      TestUtils.Simulate.change(input, {target: {value: 'Hello, world'}});
-      assert.ok($('body').find('.modal').find('button.delete').prop('disabled'));
-    });
+    TestUtils.Simulate.change(input, {target: {value: 'Hello, world'}});
+    assert.ok($('body').find('.modal').find('button.delete').prop('disabled'));
+  });
 
-    it('submitting is enabled when same db name entered', function () {
-      instance = TestUtils.renderIntoDocument(
-        <ReactComponents.DeleteDatabaseModal
-          showHide={noop}
-          modalProps={{isSystemDatabase: false, showDeleteModal: true, dbId: 'fooo'}} />,
-        container
-      );
+  it('submitting is enabled when same db name entered', function () {
+    instance = TestUtils.renderIntoDocument(
+      <ReactComponents.DeleteDatabaseModal
+        showHide={noop}
+        modalProps={{isSystemDatabase: false, showDeleteModal: true, dbId: 'fooo'}} />,
+      container
+    );
 
-      var input = $('body').find('.modal').find('input')[0];
+    var input = $('body').find('.modal').find('input')[0];
 
-      TestUtils.Simulate.change(input, {target: {value: 'fooo'}});
-      assert.notOk($('body').find('.modal').find('button.delete').prop('disabled'));
-    });
+    TestUtils.Simulate.change(input, {target: {value: 'fooo'}});
+    assert.notOk($('body').find('.modal').find('button.delete').prop('disabled'));
+  });
 
 
-  });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/docSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/docSpec.react.jsx b/app/addons/components/tests/docSpec.react.jsx
index 1eb52bd..dd12277 100644
--- a/app/addons/components/tests/docSpec.react.jsx
+++ b/app/addons/components/tests/docSpec.react.jsx
@@ -9,167 +9,163 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils, sinon) {
-
-  var assert = utils.assert;
-
-  describe('Document', function () {
-    var container, el;
-
-    var doc = {};
-    _.times(1000, function (n) {
-      doc['prop' + n] = n;
-    });
-    var docContent = JSON.stringify(doc, null, '  ');
-
-    beforeEach(function () {
-      container = document.createElement('div');
-    });
-
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(el).parentNode);
-    });
-
-    it('hosts child elements', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document>
-          <div className="foo-children"></div>
-        </ReactComponents.Document>,
-        container
-      );
-      assert.ok($(ReactDOM.findDOMNode(el)).find('.foo-children').length);
-    });
-
-    it('does not require child elements', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document />,
-        container
-      );
-      assert.notOk($(ReactDOM.findDOMNode(el)).find('.doc-edit-symbol').length);
-    });
-
-    it('you can check it', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document isDeletable={true} checked={true} docIdentifier="foo" />,
-        container
-      );
-      assert.equal($(ReactDOM.findDOMNode(el)).find('[data-checked="true"]').length, 1);
-    });
-
-    it('you can uncheck it', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document isDeletable={true} docIdentifier="foo" />,
-        container
-      );
-      assert.equal($(ReactDOM.findDOMNode(el)).find('[data-checked="true"]').length, 0);
-    });
-
-    it('it calls an onchange callback', function () {
-      var spy = sinon.spy();
-
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document doc={{id: "foo"}} isDeletable={true} docChecked={spy} docIdentifier="foo" />,
-        container
-      );
-      var testEl = $(ReactDOM.findDOMNode(el)).find('input[type="checkbox"]')[0];
-      TestUtils.Simulate.change(testEl, {target: {value: 'Hello, world'}});
-      assert.ok(spy.calledOnce);
-    });
-
-    it('it calls an dblclick callback', function () {
-      var spy = sinon.spy();
-
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document isDeletable={true} onDoubleClick={spy} docIdentifier="foo" />,
-        container
-      );
-      TestUtils.Simulate.doubleClick(ReactDOM.findDOMNode(el));
-      assert.ok(spy.calledOnce);
-    });
-
-    it('can render without checkbox', function () {
-      var spy = sinon.spy();
-
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document isDeletable={false} onDoubleClick={spy} docIdentifier="foo" />,
-        container
-      );
-      assert.notOk($(ReactDOM.findDOMNode(el)).find('input[type="checkbox"]').length);
-      assert.ok($(ReactDOM.findDOMNode(el)).find('.checkbox-dummy').length);
-    });
-
-    it('contains a doc-data element when there\'s doc content', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document isDeletable={true} checked={true} docIdentifier="foo" docContent='{ "content": true }' />,
-        container
-      );
-      assert.equal(1, $(ReactDOM.findDOMNode(el)).find('.doc-data').length);
-    });
-
-    it('doesn\'t contain a doc-data element when there\'s no doc content', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document isDeletable={true} checked={true} docIdentifier="foo" docContent='' />,
-        container
-      );
-      assert.equal(0, $(ReactDOM.findDOMNode(el)).find('.doc-data').length);
-    });
-
-    it('allows empty headers', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document header={null} isDeletable={true} checked={true} docIdentifier="foo" docContent='' />,
-        container
-      );
-      assert.equal('', $(ReactDOM.findDOMNode(el)).find('.header-doc-id').text());
-    });
-
-    it('allows supports headers with "', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent='' />,
-        container
-      );
-      assert.equal('"foo"', $(ReactDOM.findDOMNode(el)).find('.header-doc-id').text());
-    });
-
-    it('small docs should not be truncated', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent='{ "content": true }' />,
-        container
-      );
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.doc-content-truncated').length, 0);
-    });
-
-    it('large docs should get truncated', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent={docContent} />,
-        container
-      );
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.doc-content-truncated').length, 1);
-    });
-
-    it('custom truncate value', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent={docContent} maxRows={2000} />,
-        container
-      );
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.doc-content-truncated').length, 0);
-    });
-
-    it('disabling truncation', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent={docContent} truncate={false} />,
-        container
-      );
-      assert.equal($(ReactDOM.findDOMNode(el)).find('.doc-content-truncated').length, 0);
-    });
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
+
+var assert = utils.assert;
+
+describe('Document', function () {
+  var container, el;
+
+  var doc = {};
+  _.times(1000, function (n) {
+    doc['prop' + n] = n;
+  });
+  var docContent = JSON.stringify(doc, null, '  ');
+
+  beforeEach(function () {
+    container = document.createElement('div');
+  });
+
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(el).parentNode);
+  });
+
+  it('hosts child elements', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document>
+        <div className="foo-children"></div>
+      </ReactComponents.Document>,
+      container
+    );
+    assert.ok($(ReactDOM.findDOMNode(el)).find('.foo-children').length);
+  });
+
+  it('does not require child elements', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document />,
+      container
+    );
+    assert.notOk($(ReactDOM.findDOMNode(el)).find('.doc-edit-symbol').length);
+  });
+
+  it('you can check it', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document isDeletable={true} checked={true} docIdentifier="foo" />,
+      container
+    );
+    assert.equal($(ReactDOM.findDOMNode(el)).find('[data-checked="true"]').length, 1);
+  });
+
+  it('you can uncheck it', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document isDeletable={true} docIdentifier="foo" />,
+      container
+    );
+    assert.equal($(ReactDOM.findDOMNode(el)).find('[data-checked="true"]').length, 0);
+  });
+
+  it('it calls an onchange callback', function () {
+    var spy = sinon.spy();
+
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document doc={{id: "foo"}} isDeletable={true} docChecked={spy} docIdentifier="foo" />,
+      container
+    );
+    var testEl = $(ReactDOM.findDOMNode(el)).find('input[type="checkbox"]')[0];
+    TestUtils.Simulate.change(testEl, {target: {value: 'Hello, world'}});
+    assert.ok(spy.calledOnce);
+  });
+
+  it('it calls an dblclick callback', function () {
+    var spy = sinon.spy();
+
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document isDeletable={true} onDoubleClick={spy} docIdentifier="foo" />,
+      container
+    );
+    TestUtils.Simulate.doubleClick(ReactDOM.findDOMNode(el));
+    assert.ok(spy.calledOnce);
+  });
+
+  it('can render without checkbox', function () {
+    var spy = sinon.spy();
+
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document isDeletable={false} onDoubleClick={spy} docIdentifier="foo" />,
+      container
+    );
+    assert.notOk($(ReactDOM.findDOMNode(el)).find('input[type="checkbox"]').length);
+    assert.ok($(ReactDOM.findDOMNode(el)).find('.checkbox-dummy').length);
+  });
+
+  it('contains a doc-data element when there\'s doc content', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document isDeletable={true} checked={true} docIdentifier="foo" docContent='{ "content": true }' />,
+      container
+    );
+    assert.equal(1, $(ReactDOM.findDOMNode(el)).find('.doc-data').length);
+  });
+
+  it('doesn\'t contain a doc-data element when there\'s no doc content', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document isDeletable={true} checked={true} docIdentifier="foo" docContent='' />,
+      container
+    );
+    assert.equal(0, $(ReactDOM.findDOMNode(el)).find('.doc-data').length);
+  });
+
+  it('allows empty headers', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document header={null} isDeletable={true} checked={true} docIdentifier="foo" docContent='' />,
+      container
+    );
+    assert.equal('', $(ReactDOM.findDOMNode(el)).find('.header-doc-id').text());
+  });
+
+  it('allows supports headers with "', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent='' />,
+      container
+    );
+    assert.equal('"foo"', $(ReactDOM.findDOMNode(el)).find('.header-doc-id').text());
+  });
+
+  it('small docs should not be truncated', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent='{ "content": true }' />,
+      container
+    );
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.doc-content-truncated').length, 0);
+  });
+
+  it('large docs should get truncated', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent={docContent} />,
+      container
+    );
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.doc-content-truncated').length, 1);
+  });
+
+  it('custom truncate value', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent={docContent} maxRows={2000} />,
+      container
+    );
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.doc-content-truncated').length, 0);
+  });
 
+  it('disabling truncation', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.Document header="foo" isDeletable={true} checked={true} docIdentifier="foo" docContent={docContent} truncate={false} />,
+      container
+    );
+    assert.equal($(ReactDOM.findDOMNode(el)).find('.doc-content-truncated').length, 0);
   });
 
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/headerTogglebuttonSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/headerTogglebuttonSpec.react.jsx b/app/addons/components/tests/headerTogglebuttonSpec.react.jsx
index 40f0d51..f87a6e2 100644
--- a/app/addons/components/tests/headerTogglebuttonSpec.react.jsx
+++ b/app/addons/components/tests/headerTogglebuttonSpec.react.jsx
@@ -9,34 +9,31 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils, sinon) {
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
 
-  var assert = utils.assert;
+var assert = utils.assert;
 
-  describe('Header Togglebutton', function () {
-    var container, toggleEl, toggleCallback;
-    beforeEach(function () {
-      container = document.createElement('div');
-      toggleCallback = sinon.spy();
-      toggleEl = TestUtils.renderIntoDocument(<ReactComponents.ToggleHeaderButton fonticon={'foo'}
-        classString={'bar'} toggleCallback={toggleCallback} />, container);
-    });
+describe('Header Togglebutton', function () {
+  var container, toggleEl, toggleCallback;
+  beforeEach(function () {
+    container = document.createElement('div');
+    toggleCallback = sinon.spy();
+    toggleEl = TestUtils.renderIntoDocument(<ReactComponents.ToggleHeaderButton fonticon={'foo'}
+      classString={'bar'} toggleCallback={toggleCallback} />, container);
+  });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-    });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
 
-    it('should call the passed callback', function () {
-      TestUtils.Simulate.click(ReactDOM.findDOMNode(toggleEl));
-      assert.ok(toggleCallback.calledOnce);
-    });
+  it('should call the passed callback', function () {
+    TestUtils.Simulate.click(ReactDOM.findDOMNode(toggleEl));
+    assert.ok(toggleCallback.calledOnce);
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/paddedBorderedBoxSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/paddedBorderedBoxSpec.react.jsx b/app/addons/components/tests/paddedBorderedBoxSpec.react.jsx
index 9637968..3f1b317 100644
--- a/app/addons/components/tests/paddedBorderedBoxSpec.react.jsx
+++ b/app/addons/components/tests/paddedBorderedBoxSpec.react.jsx
@@ -9,37 +9,34 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils, sinon) {
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
 
-  var assert = utils.assert;
+var assert = utils.assert;
 
-  describe('PaddedBorderedBox', function () {
-    var container, el;
+describe('PaddedBorderedBox', function () {
+  var container, el;
 
-    beforeEach(function () {
-      container = document.createElement('div');
-    });
+  beforeEach(function () {
+    container = document.createElement('div');
+  });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-    });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
 
-    it('hosts child elements', function () {
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.PaddedBorderedBox>
-          <div className="foo-children"></div>
-        </ReactComponents.PaddedBorderedBox>,
-        container
-      );
-      assert.ok($(ReactDOM.findDOMNode(el)).find('.foo-children').length);
-    });
+  it('hosts child elements', function () {
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.PaddedBorderedBox>
+        <div className="foo-children"></div>
+      </ReactComponents.PaddedBorderedBox>,
+      container
+    );
+    assert.ok($(ReactDOM.findDOMNode(el)).find('.foo-children').length);
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/stringEditModalSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/stringEditModalSpec.react.jsx b/app/addons/components/tests/stringEditModalSpec.react.jsx
index f0b0e24..fbd25d8 100644
--- a/app/addons/components/tests/stringEditModalSpec.react.jsx
+++ b/app/addons/components/tests/stringEditModalSpec.react.jsx
@@ -9,45 +9,40 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  'react-bootstrap',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, ReactBootstrap, utils, React, ReactDOM, TestUtils, sinon) {
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import { Modal } from "react-bootstrap";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
 
-  var assert = utils.assert;
-  var Modal = ReactBootstrap.Modal;
+var assert = utils.assert;
 
-  describe('String Edit Modal', function () {
-    var container, el;
-    var stub = function () { };
+describe('String Edit Modal', function () {
+  var container, el;
+  var stub = function () { };
 
-    beforeEach(function () {
-      container = document.createElement('div');
-    });
+  beforeEach(function () {
+    container = document.createElement('div');
+  });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-    });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
 
-    describe('onSave', function () {
-      it('ensures same content returns on saving', function () {
-        var string = "a string!";
-        var spy = sinon.spy();
-        el = TestUtils.renderIntoDocument(
-          <ReactComponents.StringEditModal visible={true} onClose={stub} onSave={spy} value={string} />,
-          container
-        );
-        TestUtils.Simulate.click($('body').find('#string-edit-save-btn')[0]);
-        assert.ok(spy.calledOnce);
-        assert.ok(spy.calledWith(string));
-      });
+  describe('onSave', function () {
+    it('ensures same content returns on saving', function () {
+      var string = "a string!";
+      var spy = sinon.spy();
+      el = TestUtils.renderIntoDocument(
+        <ReactComponents.StringEditModal visible={true} onClose={stub} onSave={spy} value={string} />,
+        container
+      );
+      TestUtils.Simulate.click($('body').find('#string-edit-save-btn')[0]);
+      assert.ok(spy.calledOnce);
+      assert.ok(spy.calledWith(string));
     });
   });
-
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/styledSelectSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/styledSelectSpec.react.jsx b/app/addons/components/tests/styledSelectSpec.react.jsx
index 36401b7..85f304b 100644
--- a/app/addons/components/tests/styledSelectSpec.react.jsx
+++ b/app/addons/components/tests/styledSelectSpec.react.jsx
@@ -9,53 +9,50 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils, sinon) {
-
-  var assert = utils.assert;
-
-  describe('styled select', function () {
-    var container, selectorEl, spy = sinon.spy();
-
-    beforeEach(function () {
-      container = document.createElement('div');
-
-      var selectContent = (
-        <optgroup label="Select a document">
-          <option value="new">New Design Document</option>
-          <option value="foo">New Design Document</option>
-        </optgroup>
-      );
-
-      selectorEl = TestUtils.renderIntoDocument(
-        <ReactComponents.StyledSelect
-          selectId="new-ddoc"
-          selectClass=""
-          selectContent={selectContent}
-          selectChange={spy} />,
-        container
-      );
-    });
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
+
+var assert = utils.assert;
+
+describe('styled select', function () {
+  var container, selectorEl, spy = sinon.spy();
+
+  beforeEach(function () {
+    container = document.createElement('div');
+
+    var selectContent = (
+      <optgroup label="Select a document">
+        <option value="new">New Design Document</option>
+        <option value="foo">New Design Document</option>
+      </optgroup>
+    );
+
+    selectorEl = TestUtils.renderIntoDocument(
+      <ReactComponents.StyledSelect
+        selectId="new-ddoc"
+        selectClass=""
+        selectContent={selectContent}
+        selectChange={spy} />,
+      container
+    );
+  });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-    });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+  });
 
-    it('calls the callback on select', function () {
-      TestUtils.Simulate.change($(ReactDOM.findDOMNode(selectorEl)).find('#new-ddoc')[0], {
-        target: {
-          value: 'new'
-        }
-      });
-      assert.ok(spy.calledOnce);
+  it('calls the callback on select', function () {
+    TestUtils.Simulate.change($(ReactDOM.findDOMNode(selectorEl)).find('#new-ddoc')[0], {
+      target: {
+        value: 'new'
+      }
     });
-
+    assert.ok(spy.calledOnce);
   });
+
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/components/tests/zenModeSpec.react.jsx
----------------------------------------------------------------------
diff --git a/app/addons/components/tests/zenModeSpec.react.jsx b/app/addons/components/tests/zenModeSpec.react.jsx
index e513c1c..861b24f 100644
--- a/app/addons/components/tests/zenModeSpec.react.jsx
+++ b/app/addons/components/tests/zenModeSpec.react.jsx
@@ -9,55 +9,52 @@
 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 // License for the specific language governing permissions and limitations under
 // the License.
-define([
-  '../../../core/api',
-  '../react-components.react',
-  '../../../../test/mocha/testUtils',
-  'react',
-  'react-dom',
-  'react-addons-test-utils',
-  'sinon'
-], function (FauxtonAPI, ReactComponents, utils, React, ReactDOM, TestUtils, sinon) {
-
-  var assert = utils.assert;
-  var code = 'function (doc) {\n  emit(doc._id, 1);\n}';
-
-  describe('Zen Mode', function () {
-    var container, el, spy;
-
-    beforeEach(function () {
-      spy = sinon.spy();
-      container = document.createElement('div');
-      el = TestUtils.renderIntoDocument(
-        <ReactComponents.ZenModeOverlay defaultCode={code} onExit={spy} />,
-        container
-      );
-    });
+import FauxtonAPI from "../../../core/api";
+import ReactComponents from "../react-components.react";
+import utils from "../../../../test/mocha/testUtils";
+import React from "react";
+import ReactDOM from "react-dom";
+import TestUtils from "react-addons-test-utils";
+import sinon from "sinon";
+
+var assert = utils.assert;
+var code = 'function (doc) {\n  emit(doc._id, 1);\n}';
+
+describe('Zen Mode', function () {
+  var container, el, spy;
+
+  beforeEach(function () {
+    spy = sinon.spy();
+    container = document.createElement('div');
+    el = TestUtils.renderIntoDocument(
+      <ReactComponents.ZenModeOverlay defaultCode={code} onExit={spy} />,
+      container
+    );
+  });
 
-    afterEach(function () {
-      ReactDOM.unmountComponentAtNode(container);
-      window.localStorage.removeItem('zenTheme');
-    });
+  afterEach(function () {
+    ReactDOM.unmountComponentAtNode(container);
+    window.localStorage.removeItem('zenTheme');
+  });
 
-    describe('Toggle theme', function () {
-      it('defaults to dark theme', function () {
-        assert.ok($(ReactDOM.findDOMNode(el)).hasClass('zen-theme-dark'));
-      });
-
-      it('switch to light theme on click', function () {
-        TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.js-toggle-theme')[0]);
-        assert.ok($(ReactDOM.findDOMNode(el)).hasClass('zen-theme-light'));
-        // reset
-        TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.js-toggle-theme')[0]);
-      });
+  describe('Toggle theme', function () {
+    it('defaults to dark theme', function () {
+      assert.ok($(ReactDOM.findDOMNode(el)).hasClass('zen-theme-dark'));
     });
 
-    describe('Closing zen mode', function () {
-      it('method called', function () {
-        TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.js-exit-zen-mode')[0]);
-        assert.ok(spy.calledOnce);
-      });
+    it('switch to light theme on click', function () {
+      TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.js-toggle-theme')[0]);
+      assert.ok($(ReactDOM.findDOMNode(el)).hasClass('zen-theme-light'));
+      // reset
+      TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.js-toggle-theme')[0]);
     });
+  });
 
+  describe('Closing zen mode', function () {
+    it('method called', function () {
+      TestUtils.Simulate.click($(ReactDOM.findDOMNode(el)).find('.js-exit-zen-mode')[0]);
+      assert.ok(spy.calledOnce);
+    });
   });
+
 });

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/config/base.js
----------------------------------------------------------------------
diff --git a/app/addons/config/base.js b/app/addons/config/base.js
index 4676d95..a10cab0 100644
--- a/app/addons/config/base.js
+++ b/app/addons/config/base.js
@@ -10,25 +10,17 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../app',
+import app from "../../app";
+import FauxtonAPI from "../../core/api";
+import Config from "./routes";
+import "./assets/less/config.less";
+Config.initialize = function () {
+  FauxtonAPI.addHeaderLink({
+    title: 'Configuration',
+    href: '#_config',
+    icon: 'fonticon-cog',
+    className: 'config'
+  });
+};
 
-  '../../core/api',
-
-  // Modules
-  './routes',
-  './assets/less/config.less'
-],
-
-function (app, FauxtonAPI, Config) {
-  Config.initialize = function () {
-    FauxtonAPI.addHeaderLink({
-      title: 'Configuration',
-      href: '#_config',
-      icon: 'fonticon-cog',
-      className: 'config'
-    });
-  };
-
-  return Config;
-});
+export default Config;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/config/resources.js
----------------------------------------------------------------------
diff --git a/app/addons/config/resources.js b/app/addons/config/resources.js
index 4402fc9..87eb8c3 100644
--- a/app/addons/config/resources.js
+++ b/app/addons/config/resources.js
@@ -10,106 +10,100 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../app',
-  '../../core/api'
+import app from "../../app";
+import FauxtonAPI from "../../core/api";
 
-],
+var Config = FauxtonAPI.addon();
 
-function (app, FauxtonAPI) {
 
-  var Config = FauxtonAPI.addon();
+Config.OptionModel = Backbone.Model.extend({
+  documentation: FauxtonAPI.constants.DOC_URLS.CONFIG,
 
+  initialize: function (_, options) {
+    this.node = options.node;
+  },
 
-  Config.OptionModel = Backbone.Model.extend({
-    documentation: FauxtonAPI.constants.DOC_URLS.CONFIG,
+  url: function () {
+    if (!this.node) {
+      throw new Error('no node set');
+    }
 
-    initialize: function (_, options) {
-      this.node = options.node;
-    },
+    return app.host + '/_node/' + this.node + '/_config/' +
+      this.get('section') + '/' + encodeURIComponent(this.get('name'));
+  },
 
-    url: function () {
-      if (!this.node) {
-        throw new Error('no node set');
-      }
+  isNew: function () { return false; },
 
-      return app.host + '/_node/' + this.node + '/_config/' +
-        this.get('section') + '/' + encodeURIComponent(this.get('name'));
-    },
+  sync: function (method, model, options) {
 
-    isNew: function () { return false; },
+    var params = {
+      url: model.url(),
+      contentType: 'application/json',
+      dataType: 'json',
+      data: JSON.stringify(model.get('value'))
+    };
 
-    sync: function (method, model, options) {
+    if (method === 'delete') {
+      params.type = 'DELETE';
+    } else {
+      params.type = 'PUT';
+    }
+    return $.ajax(params);
+  }
+});
 
-      var params = {
-        url: model.url(),
-        contentType: 'application/json',
-        dataType: 'json',
-        data: JSON.stringify(model.get('value'))
-      };
+Config.Model = Backbone.Model.extend({});
+Config.Collection = Backbone.Collection.extend({
+  model: Config.Model,
 
-      if (method === 'delete') {
-        params.type = 'DELETE';
-      } else {
-        params.type = 'PUT';
-      }
-      return $.ajax(params);
+  documentation: FauxtonAPI.constants.DOC_URLS.CONFIG,
+
+  initialize: function (_, options) {
+    this.node = options.node;
+  },
+
+  comparator: function (OptionModel) {
+    if (OptionModel.get('section')) {
+      return OptionModel.get('section');
     }
-  });
-
-  Config.Model = Backbone.Model.extend({});
-  Config.Collection = Backbone.Collection.extend({
-    model: Config.Model,
-
-    documentation: FauxtonAPI.constants.DOC_URLS.CONFIG,
-
-    initialize: function (_, options) {
-      this.node = options.node;
-    },
-
-    comparator: function (OptionModel) {
-      if (OptionModel.get('section')) {
-        return OptionModel.get('section');
-      }
-    },
-
-    url: function () {
-      if (!this.node) {
-        throw new Error('no node set');
-      }
-
-      return app.host + '/_node/' + this.node + '/_config';
-    },
-
-    findEntryInSection: function (sectionName, entry) {
-      var section = _.findWhere(this.toJSON(), {'section': sectionName}),
-          options;
-
-      if (!section) {
-        return false;
-      }
-
-      options = _.findWhere(section.options, {name: entry});
-
-      return options;
-    },
-
-    parse: function (resp) {
-      return _.map(resp, function (section, section_name) {
-        return {
-          section: section_name,
-          options: _.map(section, function (option, option_name) {
-            return {
-              name: option_name,
-              value: option
-            };
-          })
-        };
-      });
+  },
+
+  url: function () {
+    if (!this.node) {
+      throw new Error('no node set');
     }
-  });
 
+    return app.host + '/_node/' + this.node + '/_config';
+  },
 
+  findEntryInSection: function (sectionName, entry) {
+    var section = _.findWhere(this.toJSON(), {'section': sectionName}),
+        options;
 
-  return Config;
+    if (!section) {
+      return false;
+    }
+
+    options = _.findWhere(section.options, {name: entry});
+
+    return options;
+  },
+
+  parse: function (resp) {
+    return _.map(resp, function (section, section_name) {
+      return {
+        section: section_name,
+        options: _.map(section, function (option, option_name) {
+          return {
+            name: option_name,
+            value: option
+          };
+        })
+      };
+    });
+  }
 });
+
+
+
+export default Config;

http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/0ca35da7/app/addons/config/routes.js
----------------------------------------------------------------------
diff --git a/app/addons/config/routes.js b/app/addons/config/routes.js
index 3f051ad..a94b702 100644
--- a/app/addons/config/routes.js
+++ b/app/addons/config/routes.js
@@ -10,91 +10,86 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-define([
-  '../../app',
-  '../../core/api',
-  './resources',
-  './views',
-  '../cors/components.react',
-  '../cors/actions',
-  '../cluster/cluster.actions'
-],
-
-function (app, FauxtonAPI, Config, Views, CORSComponents, CORSActions, ClusterActions) {
-
-
-  var ConfigDisabledRouteObject = FauxtonAPI.RouteObject.extend({
-    layout: 'one_pane',
-
-    routes: {
-      '_config': 'checkNodes',
-    },
-
-    crumbs: [
-      { name: 'Config disabled', link: '_config' }
-    ],
-
-    checkNodes: function () {
-      ClusterActions.navigateToNodeBasedOnNodeCount('/_config/');
-    }
-  });
-
-
-  var ConfigPerNodeRouteObject = FauxtonAPI.RouteObject.extend({
-    layout: 'with_tabs_sidebar',
-
-    roles: ['_admin'],
-    selectedHeader: 'Config',
-
-    crumbs: [
-      { name: 'Config', link: '_config' }
-    ],
-
-    apiUrl: function () {
-      return [this.configs.url(), this.configs.documentation];
-    },
-
-    routes: {
-      '_config/:node': 'configForNode',
-      '_config/:node/cors': 'configCorsForNode'
-    },
-
-    initialize: function (_a, _b, options) {
-      var node = options[0];
-
-      this.configs = new Config.Collection(null, {node: node});
-
-      this.sidebar = this.setView('#sidebar-content', new Views.Tabs({
-        sidebarItems: [
-          {
-            title: 'Main config',
-            typeSelect: 'main',
-            link: '_config/' + node
-          },
-          {
-            title: 'CORS',
-            typeSelect: 'cors',
-            link: '_config/' + node + '/cors'
-          }
-        ]
-      }));
-    },
-
-    configForNode: function () {
-      this.newSection = this.setView('#right-header', new Views.ConfigHeader({ collection: this.configs }));
-      this.setView('#dashboard-lower-content', new Views.Table({ collection: this.configs }));
-      this.sidebar.setSelectedTab('main');
-    },
-
-    configCorsForNode: function (node) {
-      this.removeView('#right-header');
-      this.newSection = this.setComponent('#dashboard-content', CORSComponents.CORSController);
-      CORSActions.fetchAndEditCors(node);
-      this.sidebar.setSelectedTab('cors');
-    }
-  });
-
-  Config.RouteObjects = [ConfigPerNodeRouteObject, ConfigDisabledRouteObject];
-
-  return Config;
+import app from "../../app";
+import FauxtonAPI from "../../core/api";
+import Config from "./resources";
+import Views from "./views";
+import CORSComponents from "../cors/components.react";
+import CORSActions from "../cors/actions";
+import ClusterActions from "../cluster/cluster.actions";
+
+
+var ConfigDisabledRouteObject = FauxtonAPI.RouteObject.extend({
+  layout: 'one_pane',
+
+  routes: {
+    '_config': 'checkNodes',
+  },
+
+  crumbs: [
+    { name: 'Config disabled', link: '_config' }
+  ],
+
+  checkNodes: function () {
+    ClusterActions.navigateToNodeBasedOnNodeCount('/_config/');
+  }
 });
+
+
+var ConfigPerNodeRouteObject = FauxtonAPI.RouteObject.extend({
+  layout: 'with_tabs_sidebar',
+
+  roles: ['_admin'],
+  selectedHeader: 'Config',
+
+  crumbs: [
+    { name: 'Config', link: '_config' }
+  ],
+
+  apiUrl: function () {
+    return [this.configs.url(), this.configs.documentation];
+  },
+
+  routes: {
+    '_config/:node': 'configForNode',
+    '_config/:node/cors': 'configCorsForNode'
+  },
+
+  initialize: function (_a, _b, options) {
+    var node = options[0];
+
+    this.configs = new Config.Collection(null, {node: node});
+
+    this.sidebar = this.setView('#sidebar-content', new Views.Tabs({
+      sidebarItems: [
+        {
+          title: 'Main config',
+          typeSelect: 'main',
+          link: '_config/' + node
+        },
+        {
+          title: 'CORS',
+          typeSelect: 'cors',
+          link: '_config/' + node + '/cors'
+        }
+      ]
+    }));
+  },
+
+  configForNode: function () {
+    this.newSection = this.setView('#right-header', new Views.ConfigHeader({ collection: this.configs }));
+    this.setView('#dashboard-lower-content', new Views.Table({ collection: this.configs }));
+    this.sidebar.setSelectedTab('main');
+  },
+
+  configCorsForNode: function (node) {
+    this.removeView('#right-header');
+    this.newSection = this.setComponent('#dashboard-content', CORSComponents.CORSController);
+    CORSActions.fetchAndEditCors(node);
+    this.sidebar.setSelectedTab('cors');
+  }
+});
+
+Config.RouteObjects = [ConfigPerNodeRouteObject, ConfigDisabledRouteObject];
+
+export default Config;


Mime
View raw message