Skip to content

Commit

Permalink
adding test for buffer case
Browse files Browse the repository at this point in the history
  • Loading branch information
adl-trey committed Jul 31, 2024
1 parent f3de30c commit ebfcf48
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions player/service/tests/xml.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,16 @@ describe("XML Parsing and Usage", async () => {

chai.expect(parsedText).to.be.equal(expectedText, "The provided XML was not parsed into the expected text");
});


it ("Handles when a Buffer is provided instead of a string", async() => {

let providedText = '\u0000Some text\u0000🎉🎉\u0000';
let providedBuffer = Buffer.from(providedText);
let expectedText = 'Some text';

let parsedText = await helpers.sanitizeXML(providedBuffer);

chai.expect(parsedText).to.be.equal(expectedText, "The provided XML was not parsed into the expected text");
});
});

0 comments on commit ebfcf48

Please sign in to comment.