-
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.
SWI-4587 Add
transferCallerDisplayName
to Transfer Verb (#17)
- Loading branch information
Showing
3 changed files
with
8 additions
and
5 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
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ const { Transfer } = require('../../../../models/bxml/verbs/Transfer'); | |
describe('Transfer', () => { | ||
const attributes = { | ||
transferCallerId: '+19195551234', | ||
transferCallerDisplayName: 'initialDisplayName', | ||
callTimeout: 5, | ||
transferCompleteUrl: 'https://initial.com', | ||
transferCompleteMethod: 'POST', | ||
|
@@ -25,7 +26,7 @@ describe('Transfer', () => { | |
|
||
test('should create a Transfer Verb', () => { | ||
const transfer = new Transfer(attributes); | ||
const expected = '<Transfer transferCallerId="+19195551234" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"/>'; | ||
const expected = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"/>'; | ||
|
||
expect(transfer).toBeInstanceOf(Transfer); | ||
expect(transfer).toBeInstanceOf(Verb); | ||
|
@@ -34,9 +35,9 @@ describe('Transfer', () => { | |
|
||
test('should create a Transfer Verb with nested PhoneNumber and SipUri', () => { | ||
let transfer = new Transfer(attributes, phoneNumber); | ||
const expected = '<Transfer transferCallerId="+19195551234" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber></Transfer>'; | ||
const expectedSingle = '<Transfer transferCallerId="+19195551234" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber><SipUri>sip:[email protected]</SipUri></Transfer>'; | ||
const expectedMultiple = '<Transfer transferCallerId="+19195551234" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber><SipUri>sip:[email protected]</SipUri><SipUri>sip:[email protected]</SipUri><PhoneNumber>+19195551234</PhoneNumber></Transfer>'; | ||
const expected = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber></Transfer>'; | ||
const expectedSingle = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber><SipUri>sip:[email protected]</SipUri></Transfer>'; | ||
const expectedMultiple = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber><SipUri>sip:[email protected]</SipUri><SipUri>sip:[email protected]</SipUri><PhoneNumber>+19195551234</PhoneNumber></Transfer>'; | ||
|
||
expect(transfer).toBeInstanceOf(Transfer); | ||
expect(transfer).toBeInstanceOf(Verb); | ||
|
@@ -51,7 +52,7 @@ describe('Transfer', () => { | |
|
||
test('should test the addTransferRecipients method method when no verbs are initially nested', () => { | ||
const transfer = new Transfer(attributes); | ||
const expected = '<Transfer transferCallerId="+19195551234" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber></Transfer>'; | ||
const expected = '<Transfer transferCallerId="+19195551234" transferCallerDisplayName="initialDisplayName" callTimeout="5" transferCompleteUrl="https://initial.com" transferCompleteMethod="POST" transferCompleteFallbackUrl="https://initial.com" transferCompleteFallbackMethod="POST" username="initialUsername" password="initialPassword" fallbackUsername="initialFallbackUsername" fallbackPassword="initialFallbackPassword" tag="initialTag" diversionTreatment="propagate" diversionReason="user-busy"><PhoneNumber>+19195551234</PhoneNumber></Transfer>'; | ||
|
||
transfer.addTransferRecipients(phoneNumber); | ||
expect(transfer.toBxml()).toBe(expected); | ||
|