From cc1ae3c2e7f62111d05309b9cd995d2f3c2ae482 Mon Sep 17 00:00:00 2001 From: Lisa Passing Date: Wed, 22 Apr 2015 17:06:36 +0200 Subject: [PATCH] add some simple tests to hooks-list-item --- .../components/hooks-list-item-test.coffee | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tests/unit/components/hooks-list-item-test.coffee b/tests/unit/components/hooks-list-item-test.coffee index 848f84ba..f0ddafdc 100644 --- a/tests/unit/components/hooks-list-item-test.coffee +++ b/tests/unit/components/hooks-list-item-test.coffee @@ -2,16 +2,23 @@ moduleForComponent 'hooks-list-item', 'HooksListItemComponent', { # specify the other units that are required for this test - # needs: ['component:foo', 'helper:bar'] + needs: ['component:hook-switch'] } test 'it renders', -> - expect 2 - # creates the component instance - component = @subject() - equal component._state, 'preRender' - - # appends the component to the page + attributes = { + id: 10000, + name: "foo-bar", + owner_name: "foo", + description: "A foo repo", + active: true, + urlGithub: "https://github.com/foo/foobar", + slug: "foo/foo-bar" + } + component = @subject(hook: attributes) @append() - equal component._state, 'inDOM' + + ok component.$().hasClass('active'), 'component should have active class' + ok component.$('.travis-switch').hasClass('active'), 'switch should have active class' + equal component.$('.profile-repo span').text().trim(), 'A foo repo', 'repo description should be displayed'