Skip to content

Commit ebfcf48

Browse files
committed
adding test for buffer case
1 parent f3de30c commit ebfcf48

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

player/service/tests/xml.spec.js

+12
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,16 @@ describe("XML Parsing and Usage", async () => {
3434

3535
chai.expect(parsedText).to.be.equal(expectedText, "The provided XML was not parsed into the expected text");
3636
});
37+
38+
39+
it ("Handles when a Buffer is provided instead of a string", async() => {
40+
41+
let providedText = '\u0000Some text\u0000🎉🎉\u0000';
42+
let providedBuffer = Buffer.from(providedText);
43+
let expectedText = 'Some text';
44+
45+
let parsedText = await helpers.sanitizeXML(providedBuffer);
46+
47+
chai.expect(parsedText).to.be.equal(expectedText, "The provided XML was not parsed into the expected text");
48+
});
3749
});

0 commit comments

Comments
 (0)