couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garrensmith <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request: Changes page Filters tab moved to Re...
Date Wed, 18 Feb 2015 08:43:24 GMT
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/265#discussion_r24885676
  
    --- Diff: app/addons/documents/tests/changes.componentsSpec.react.jsx ---
    @@ -0,0 +1,215 @@
    +// Licensed under the Apache License, Version 2.0 (the "License"); you may not
    +// use this file except in compliance with the License. You may obtain a copy of
    +// the License at
    +//
    +//   http://www.apache.org/licenses/LICENSE-2.0
    +//
    +// Unless required by applicable law or agreed to in writing, software
    +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    +// 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([
    +  'app',
    +  'api',
    +  'react',
    +  'addons/documents/changes/components.react',
    +  'addons/documents/changes/stores',
    +  'addons/documents/changes/actions',
    +  'testUtils'
    +], function (app, FauxtonAPI, React, Changes, Stores, Actions, utils) {
    +  FauxtonAPI.router = new FauxtonAPI.Router([]);
    +
    +  var assert = utils.assert;
    +  var TestUtils = React.addons.TestUtils;
    +
    +
    +  describe('ChangesHeader', function () {
    +    var container, tab, spy;
    +
    +    describe('Testing DOM', function () {
    +      beforeEach(function () {
    +        spy = sinon.spy(Actions, 'toggleTabVisibility');
    +        container = document.createElement('div');
    +        tab = TestUtils.renderIntoDocument(<Changes.ChangesHeader />, container);
    +      });
    +
    +      afterEach(function () {
    +        Stores.changesFilterStore.reset();
    +        React.unmountComponentAtNode(container);
    +      });
    +
    +      // similar as previous, except it confirms that the action gets fired, not the
custom toggle func
    +      it('calls toggleTabVisibility action on selecting a tab', function () {
    +        TestUtils.Simulate.click($(tab.getDOMNode()).find('a')[0]);
    +        assert.ok(spy.calledOnce);
    +      });
    +    });
    +
    +    it('toggleTabVisibility() changes state in store', function() {
    +      assert.ok(Stores.changesHeaderStore.isTabVisible() === false);
    +      Stores.changesHeaderStore.toggleTabVisibility();
    +      assert.ok(Stores.changesHeaderStore.isTabVisible() === true);
    +    });
    +
    +    it('reset() changes tab visiblity to hidden', function() {
    +      Stores.changesHeaderStore.toggleTabVisibility();
    +      Stores.changesHeaderStore.reset();
    +      assert.ok(Stores.changesHeaderStore.isTabVisible() === false);
    +    });
    +
    +//    reset: function () {
    --- End diff --
    
    You can probably just remove these


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message