@@ -44,6 +44,7 @@ describe("Regex.", () => {
4444 expect ( result3 ) . to . be . null ;
4545 } ) ;
4646 } ) ;
47+
4748 describe ( "extractUuidFromUrl -" , function ( ) {
4849 it ( "uuid" , function ( ) {
4950 const result = Regex . extractUuidFromUrl ( mocks . webApiUrl + "tests(fb15ee32-524d-41be-b6a0-7d0f28055d52)" ) ;
@@ -56,6 +57,32 @@ describe("Regex.", () => {
5657 expect ( result2 ) . to . be . null ;
5758 } ) ;
5859 } ) ;
60+
61+ describe ( "extractPreferCallbackUrl -" , function ( ) {
62+ it ( "url" , function ( ) {
63+ const result = Regex . extractPreferCallbackUrl ( 'odata.callback;url="https://test.com"' ) ;
64+ expect ( result ) . to . equal ( "https://test.com" ) ;
65+ } ) ;
66+ it ( "not url - returns null" , function ( ) {
67+ const result = Regex . extractPreferCallbackUrl ( "something" ) ;
68+ expect ( result ) . to . be . null ;
69+ } ) ;
70+ } ) ;
71+
72+ describe ( "getUpdateMethod -" , function ( ) {
73+ it ( "PATCH" , function ( ) {
74+ const result = Regex . getUpdateMethod ( "anything" ) ;
75+ expect ( result ) . to . equal ( "PATCH" ) ;
76+ } ) ;
77+ it ( "PUT" , function ( ) {
78+ const result = Regex . getUpdateMethod ( "EntityDefinitions" ) ;
79+ expect ( result ) . to . equal ( "PUT" ) ;
80+ } ) ;
81+ it ( "not PUT or PATCH - returns null" , function ( ) {
82+ const result = Regex . getUpdateMethod ( null ) ;
83+ expect ( result ) . to . equal ( "PATCH" ) ;
84+ } ) ;
85+ } ) ;
5986} ) ;
6087
6188describe ( "RequestClient.sendRequest" , ( ) => {
0 commit comments