1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
describe "views", ->
$inputor = null
app = null
$ = jQuery
beforeEach ->
loadFixtures "inputors.html"
$inputor = $ "#inputor"
.atwho at: "@", data: fixtures["names"]
app = getAppOf $inputor
afterEach ->
$inputor.atwho 'destroy'
describe "issues", ->
controller = null
callbacks = null
beforeEach ->
controller = app.controller()
callbacks = $.fn.atwho.default.callbacks
simulateTypingIn $inputor
it "selected no highlight(.cur); github issues#234", ->
simulateTypingIn $inputor
expect targetLi = controller.view.$el.find('ul li:last')
.not.toHaveClass 'cur'
spyOn controller.view, "choose"
.and.callThrough()
targetLi.trigger clickEvent = $.Event("click.atwho-view")
expect targetLi
.toHaveClass 'cur'
it "only hides on scroll if scrollTop is changed (github issue #305)", ->
simulateTypingIn $inputor
expect(controller.view.visible()).toBe true
$inputor.trigger 'scroll'
expect(controller.view.visible()).toBe true
|