Fixed issue #2105 update button unusable after modal dialog is gone
This commit is contained in:
parent
370b1a2645
commit
730ed13b7b
2 changed files with 96 additions and 0 deletions
|
@ -29,6 +29,10 @@ class App.TicketZoomTimeAccounting extends App.ControllerModal
|
|||
return if !@cancelCallback
|
||||
@cancelCallback()
|
||||
|
||||
onClose: ->
|
||||
return if !@cancelCallback
|
||||
@cancelCallback()
|
||||
|
||||
onSubmit: =>
|
||||
@$('[name="time_unit"]').removeClass('has-error')
|
||||
params = @formParams()
|
||||
|
|
|
@ -158,4 +158,96 @@ class AgentTicketTimeAccountingTest < TestCase
|
|||
# off still active timeaccounting
|
||||
logout()
|
||||
end
|
||||
|
||||
def test_closing_time_accounting_modal_by_clicking_background
|
||||
@browser = browser_instance
|
||||
login(
|
||||
username: 'master@example.com',
|
||||
password: 'test',
|
||||
url: browser_url,
|
||||
)
|
||||
tasks_close_all()
|
||||
|
||||
# enable time accounting
|
||||
click(
|
||||
css: 'a[href="#manage"]',
|
||||
)
|
||||
click(
|
||||
css: '.content.active a[href="#manage/time_accounting"]',
|
||||
)
|
||||
switch(
|
||||
css: '.content.active .js-timeAccountingSetting',
|
||||
type: 'on',
|
||||
)
|
||||
|
||||
ticket1 = ticket_create(
|
||||
data: {
|
||||
customer: 'nico',
|
||||
group: 'Users',
|
||||
title: 'some subject - time accounting#3',
|
||||
body: 'some body - time accounting#3',
|
||||
},
|
||||
)
|
||||
|
||||
ticket_update(
|
||||
data: {
|
||||
body: 'some note',
|
||||
},
|
||||
do_not_submit: true,
|
||||
)
|
||||
click(
|
||||
css: '.active .js-submit',
|
||||
)
|
||||
|
||||
watch_for(
|
||||
css: '.content.active .modal',
|
||||
value: 'Time Accounting',
|
||||
)
|
||||
|
||||
# Click outside the modal to make it disappear
|
||||
execute(
|
||||
js: 'document.elementFromPoint(300, 100).click();',
|
||||
)
|
||||
watch_for_disappear(
|
||||
css: '.content.active .modal',
|
||||
value: 'Time Accounting',
|
||||
)
|
||||
|
||||
click(
|
||||
css: '.active .js-submit',
|
||||
)
|
||||
watch_for(
|
||||
css: '.content.active .modal',
|
||||
value: 'Time Accounting',
|
||||
)
|
||||
|
||||
set(
|
||||
css: '.content.active .modal [name=time_unit]',
|
||||
value: '4',
|
||||
)
|
||||
click(
|
||||
css: '.content.active .modal .js-submit',
|
||||
)
|
||||
watch_for_disappear(
|
||||
css: '.content.active .modal',
|
||||
value: 'Time Accounting',
|
||||
)
|
||||
|
||||
# disable time accounting
|
||||
click(
|
||||
css: 'a[href="#manage"]',
|
||||
)
|
||||
click(
|
||||
css: '.content.active a[href="#manage/time_accounting"]',
|
||||
)
|
||||
switch(
|
||||
css: '.content.active .js-timeAccountingSetting',
|
||||
type: 'off',
|
||||
)
|
||||
|
||||
# make sure "off" AJAX request gets completed
|
||||
# otherwise following tests might fail because
|
||||
# off still active timeaccounting
|
||||
logout()
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue