Skip to content

Commit 4f89e60

Browse files
committed
test
1 parent 2b31975 commit 4f89e60

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/components/PVutils.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ test("getPvValue returns the text value when text is provided", () => {
193193
});
194194

195195
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 }; // Base64 for 'Hello World'
201+
const result = getPvValue(updatedPV);
202+
expect(result).toBe(original);
203+
});
204+
205+
test("getPvValue decodes and returns base64 value with strange characters when b64byt is provided", () => {
196206
const updatedPV = { type: "update", pv: "test", b64byt: "SGVsbG8gV29ybGQ=" }; // Base64 for 'Hello World'
197207
const result = getPvValue(updatedPV);
198208
expect(result).toBe("Hello World");

0 commit comments

Comments
 (0)