forked from zammad/zammad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes zammad#2017 phone notify not clearing
- Loading branch information
Showing
3 changed files
with
73 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
test/browser/phone_notify_not_clearing_on_leftside_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
require 'browser_test_helper' | ||
|
||
# Regression test for #2017 | ||
|
||
class PhoneNotifyNotClearingOnLeftsideTest < TestCase | ||
def test_notify_badge | ||
id = rand(99_999_999) | ||
|
||
@browser = browser_instance | ||
login( | ||
username: '[email protected]', | ||
password: 'test', | ||
url: browser_url, | ||
) | ||
|
||
click(css: 'a[href="#manage"]') | ||
click(css: 'a[href="#system/integration"]') | ||
click(css: 'a[href="#system/integration/sipgate"]') | ||
|
||
if !@browser.find_element(css: 'input[name=sipgate_integration]').property('checked') | ||
switch( | ||
css: '.active .js-switch', | ||
type: 'on' | ||
) | ||
end | ||
|
||
watch_for( | ||
css: 'a[href="#cti"]' | ||
) | ||
|
||
click(css: 'a[href="#cti"]') | ||
|
||
# simulate sipgate callbacks | ||
|
||
url = URI.join(browser_url, 'api/v1/sipgate/in') | ||
params = { direction: 'in', from: '491715000002', to: '4930600000000', callId: "4991155921769858278-#{id}", cause: 'busy' } | ||
Net::HTTP.post_form(url, params.merge(event: 'newCall')) | ||
Net::HTTP.post_form(url, params.merge(event: 'hangup')) | ||
|
||
watch_for( | ||
css: '.js-phoneMenuItem .counter', | ||
value: '1' | ||
) | ||
|
||
@browser.find_element(css: '.table-checkbox label').click | ||
|
||
watch_for_disappear( | ||
css: '.js-phoneMenuItem .counter' | ||
) | ||
end | ||
end |