add some simple tests to hooks-list-item
This commit is contained in:
parent
f9563187d3
commit
cc1ae3c2e7
|
@ -2,16 +2,23 @@
|
||||||
|
|
||||||
moduleForComponent 'hooks-list-item', 'HooksListItemComponent', {
|
moduleForComponent 'hooks-list-item', 'HooksListItemComponent', {
|
||||||
# specify the other units that are required for this test
|
# specify the other units that are required for this test
|
||||||
# needs: ['component:foo', 'helper:bar']
|
needs: ['component:hook-switch']
|
||||||
}
|
}
|
||||||
|
|
||||||
test 'it renders', ->
|
test 'it renders', ->
|
||||||
expect 2
|
|
||||||
|
|
||||||
# creates the component instance
|
attributes = {
|
||||||
component = @subject()
|
id: 10000,
|
||||||
equal component._state, 'preRender'
|
name: "foo-bar",
|
||||||
|
owner_name: "foo",
|
||||||
# appends the component to the page
|
description: "A foo repo",
|
||||||
|
active: true,
|
||||||
|
urlGithub: "https://github.com/foo/foobar",
|
||||||
|
slug: "foo/foo-bar"
|
||||||
|
}
|
||||||
|
component = @subject(hook: attributes)
|
||||||
@append()
|
@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'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user