File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -192,17 +192,20 @@ test("getPvValue returns the text value when text is provided", () => {
192192 expect ( result ) . toBe ( "Hello World" ) ;
193193} ) ;
194194
195- test ( "getPvValue decodes and return the base64 value when b64byt is provided" , ( ) => {
196- const original =
197- "¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" ;
198- const encoded = Buffer . from ( original , "utf8" ) . toString ( "base64" ) ;
199-
200- const updatedPV = { type : "update" , pv : "test" , b64byt : encoded } ;
195+ test ( "getPvValue decodes and return the base64 value with strange characters when b64byt is provided" , ( ) => {
196+ const updatedPV = {
197+ type : "update" ,
198+ pv : "test" ,
199+ b64byt :
200+ "wqHCosKjwqTCpcKmwqfCqMKpwqrCq8Kswq7Cr8KwwrHCssKzwrTCtcK2wrfCuMK5wrrCu8K8wr3CvsK/w4DDgcOCw4PDhMOFw4bDh8OIw4nDisOLw4zDjcOOw4/DkMORw5LDk8OUw5XDlsOXw5jDmcOaw5vDnMOdw57Dn8Ogw6HDosOjw6TDpcOmw6fDqMOpw6rDq8Osw63DrsOvw7DDscOyw7PDtMO1w7bDt8O4w7nDusO7w7zDvcO+w78=" ,
201+ } ;
201202 const result = getPvValue ( updatedPV ) ;
202- expect ( result ) . toBe ( original ) ;
203+ expect ( result ) . toBe (
204+ "¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" ,
205+ ) ;
203206} ) ;
204207
205- test ( "getPvValue decodes and returns base64 value with strange characters when b64byt is provided" , ( ) => {
208+ test ( "getPvValue decodes and returns base64 value when b64byt is provided" , ( ) => {
206209 const updatedPV = { type : "update" , pv : "test" , b64byt : "SGVsbG8gV29ybGQ=" } ; // Base64 for 'Hello World'
207210 const result = getPvValue ( updatedPV ) ;
208211 expect ( result ) . toBe ( "Hello World" ) ;
You can’t perform that action at this time.
0 commit comments