You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by benkeen <gi...@git.apache.org> on 2014/09/26 19:59:50 UTC

[GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter added

GitHub user benkeen opened a pull request:

    https://github.com/apache/couchdb-fauxton/pull/66

    2331 breadcrumb delimiter added

    This was a continuation of the document ID update ticket, to add a simple ">" delimiter to the breadcrumbs.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/benkeen/couchdb-fauxton 2331-breadcrumb-delimiter-added

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fauxton/pull/66.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #66
    
----
commit a6d94f327f3f622a655b8ea1a129a179e25844b2
Author: Benjamin Keen <be...@gmail.com>
Date:   2014-09-18T18:01:34Z

    minor README update to mention grunt-cli

commit 9c9ef674486e1d841e154eb8f24f3f8625a34010
Author: Benjamin Keen <be...@gmail.com>
Date:   2014-09-18T18:02:46Z

    markdown fix

commit 82067d7c39e71f6f56559c95f9d866b265fb29a4
Author: Benjamin Keen <be...@gmail.com>
Date:   2014-09-18T20:51:54Z

    jshint fix for add ons created by grunt tool

commit 14dabf8ce5cecd26cd41acd58ae4b0547676df48
Author: Benjamin Keen <be...@gmail.com>
Date:   2014-09-25T22:17:34Z

    general helper .capitalize CSS class added

commit ac2290fea355df0f7ba0abe6b070aca742abc97b
Author: Benjamin Keen <be...@gmail.com>
Date:   2014-09-18T17:51:17Z

    Added missing API link to header of edit doc page
    
    closes COUCHDB-2332

commit 27907bb075629d5ad3935a5da284a2bf594fed3e
Author: Nick Colley <ni...@gmail.com>
Date:   2014-09-22T00:07:56Z

    Replace colour variables used in various places with generic variables
    
    Allows easier theming

commit 06823674f319fc607ab8eb5e91730cdd2e2aa96c
Author: Christian Hogan <gi...@infliction.org>
Date:   2014-09-22T06:15:02Z

    COUCHDB-2337 - Fix to resolve databases subnavigation disappearing when applying filters.

commit b6a4e02cd6a1d37fda4deeaed68689461846be66
Author: Garren Smith <ga...@gmail.com>
Date:   2014-09-23T08:13:23Z

    remove unneeded 'li' in menu dropdown

commit 1e722bf5c582187c30342747770aa2afc75d4c79
Author: Garren Smith <ga...@gmail.com>
Date:   2014-09-23T09:44:05Z

    fix delete database regression

commit 1f3c88dde65061cb2319262d4c16fd946a054562
Author: Garren Smith <ga...@gmail.com>
Date:   2014-09-23T10:02:56Z

    Align question mark in api navbar

commit d85b2414d394e34dd680fa5ee564134975f5a529
Author: Alexander Shorin <kx...@apache.org>
Date:   2014-09-23T11:51:51Z

    Fix align of navbar items on all dbs page

commit 23bfa9b8fe85b6ab85570891c7b58eba796e6d99
Author: Benjamin Keen <be...@gmail.com>
Date:   2014-09-26T17:57:22Z

    added a > breadcrumb delimiter to breadcrumbs
    
    Bit fussy, because the breadcrumbs were already being used to include
    an initial “<“ link. If additional things are required of it, I think a
    refactor may be in order.

----


---
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.
---

[GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter added

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/66#issuecomment-57139659
  
    Sure! I would create `app/addon/fauxton/tests/breadcrumbsViewSpec.js` and add the tests to it. I added a template where I left a failing test for you that you can turn from red into green, but feel free to add more tests!
    
    After the Component is under test, refactoring should be quite pleasant, so if you wanted, you could start to move some logic from the view more in the direction of the Models. You then would just have to take care that your tests stay green. 
    
    We are first loading all our needed AMD Modules into the test via `define`. With `describe` from Mocha (http://visionmedia.github.io/mocha/) we are creating a new test-block. `beforeEach` runs before each test (which is defined by a function called `it`) and it will setup the environment for every test in that specific block. It is possible to nest `describe` blocks. An assertion is done via assert.equal. A full list of assertions can be found at: http://chaijs.com/api/assert/ - The `done` callbacks are helpers for asynchronous testing. Just call it if your async before/after/it is ready. The `viewSandBox` is a small helper which attaches our HTML to the DOM, so we can test it.
    
    ```javascript
    // 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',
           'addons/fauxton/components',
           'testUtils'
    ], function (app, Components, testUtils) {
      var assert = testUtils.assert,
          ViewSandbox = testUtils.ViewSandbox;
    
      describe('Breadcrumbs', function () {
        var breadcrumbs, viewSandbox;
    
        describe('3 Breadcrumbs', function () {
          // async setup with done-callback
          beforeEach(function (done) {
            // initialize a Breadcrumb-View with fake data
            breadcrumbs = new Components.Breadcrumbs({
              crumbs: [
                {link: "/root", name: "root"},
                {link: "/first", name: "first"},
                {link: "/second", name: "second"}
              ]
            });
            // render in a view-sandbox, which attaches it to the DOM
            // for us, so we can test it
            viewSandbox = new ViewSandbox();
            viewSandbox.renderView(breadcrumbs, done);
          });
    
          afterEach(function () {
            // sync cleanup (done callback not provided)!
            viewSandbox.remove();
          });
    
          // sync test
          it('should have 2 dividers between 3 breadcrumbs', function () {
            assert.equal(2, breadcrumbs.$('.divider').length);
          });
        });
    
        describe('1 Breadcrumbs', function () {
          var breadcrumbs, viewSandbox;
    
          beforeEach(function (done) {
            breadcrumbs = new Components.Breadcrumbs({
              crumbs: [
                {link: "/root", name: "root"}
              ]
            });
    
            viewSandbox = new ViewSandbox();
            viewSandbox.renderView(breadcrumbs, done);
          });
    
          afterEach(function () {
            viewSandbox.remove();
          });
    
          it('should have 0 dividers for 1 breadcrumb', function () {
    
            assert.equal(true, false);
          });
        });
      });
    });
    ```
    



---
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.
---

[GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter added

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/66#issuecomment-56998795
  
    Hi @benkeen,
    
    there are a some commits included which are already on master. Is that a rebase issue?


---
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.
---

[GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter added

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/66#issuecomment-57107999
  
    Perhaps I will ask your advice, @robertkowalski. For what I added, what I'd like to test is the following:
    1. if there's a single breadcrumb, the generated markup wouldn't contain the delimiter.
    2. if there are two breadcrumbs with non-empty labels, the markup should contain a single delimiter.
    3. [a few other conditions] 
    
    Any advice on how you'd do that? Thanks!


---
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.
---

[GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter added

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/66#issuecomment-57000733
  
    Thank you! I am unsure about that commits that are already on master and I would be really happy if you add a test that verifies the expected behavior and helps to avoid regressions in the future.
    
    If you have questions how to write a test just ping me, I am happy to help!


---
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.
---

[GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter added

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen closed the pull request at:

    https://github.com/apache/couchdb-fauxton/pull/66


---
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.
---

[GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter added

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/66#issuecomment-57002784
  
    hey @robertkowalski - yeah, I rebased from upstream to ensure I had the latest files. The only change would be the last commit [https://github.com/benkeen/couchdb-fauxton/commit/23bfa9b8fe85b6ab85570891c7b58eba796e6d99]. But this PR does look totally confusing because of it... hmm, what process would you recommend following to prevent this happening again?
    
    Regarding the test, sure np! I think I can make sense of the way it works, so let me try & I'll bug you if I get stuck. :)



---
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.
---

[GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter added

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/66#issuecomment-57141298
  
    You can then run the testsuite with 
    
        grunt test
    
    Or you can open 
    
        couchdb-fauxton/test/runner 
    
    in a browser. Click on the headlines to just run that specific test/block


---
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.
---

[GitHub] couchdb-fauxton pull request: 2331 breadcrumb delimiter added

Posted by benkeen <gi...@git.apache.org>.
Github user benkeen commented on the pull request:

    https://github.com/apache/couchdb-fauxton/pull/66#issuecomment-57194734
  
    Wow, thanks so much @robertkowalski - much appreciated! That's actually very clear. 
    
    I chatted with Garren and due to all the rebased files included in this PR I'm going to close it and open a new one with only the changed files. So we don't lose the conversation thread, I'll just link to it in the new PR.


---
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.
---