add some simple tests to hooks-list-item

This commit is contained in:
Lisa Passing 2015-04-22 17:06:36 +02:00
parent f9563187d3
commit cc1ae3c2e7

View File

@ -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'