From 61f1a3f3ba5431cfc72360df1c9313d7ac5d8fd2 Mon Sep 17 00:00:00 2001 From: Christian Bewernitz Date: Fri, 31 Mar 2023 10:25:26 +0200 Subject: [PATCH] test: add cases related to unquoted attr values and slashes --- .../__snapshots__/parse-element.test.js.snap | 27 ++++++ test/parse/parse-element.test.js | 92 ++++++++++++++++++- 2 files changed, 117 insertions(+), 2 deletions(-) diff --git a/test/parse/__snapshots__/parse-element.test.js.snap b/test/parse/__snapshots__/parse-element.test.js.snap index 50e2ddfd4..de2d1f74a 100644 --- a/test/parse/__snapshots__/parse-element.test.js.snap +++ b/test/parse/__snapshots__/parse-element.test.js.snap @@ -1,5 +1,32 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`XML Node Parse closing tag with unquoted value ending with // 1`] = ` +Object { + "warning": Array [ + "[xmldom warning] attribute \\"lazy/\\" missed quot(\\")! +@#[line:3,col:3]", + ], +} +`; + +exports[`XML Node Parse closing tag with unquoted value including / followed by space / 1`] = ` +Object { + "warning": Array [ + "[xmldom warning] attribute \\"lazy/\\" missed quot(\\")!! +@#[line:3,col:3]", + ], +} +`; + +exports[`XML Node Parse closing tag with unquoted value including / followed by space / 2`] = ` +Object { + "warning": Array [ + "[xmldom warning] attribute \\"lazy/\\" missed quot(\\")!! +@#[line:3,col:3]", + ], +} +`; + exports[`XML Node Parse namespaced attributes unclosed root tag will be closed 1`] = ` Object { "actual": "", diff --git a/test/parse/parse-element.test.js b/test/parse/parse-element.test.js index 83fae2aa4..679c60b6c 100644 --- a/test/parse/parse-element.test.js +++ b/test/parse/parse-element.test.js @@ -39,7 +39,7 @@ describe('XML Node Parse', () => { expect(actual).toBe(`Harry Potter`); }); - it('without attribute values', () => { + it('closing tag without attribute value', () => { const actual = new DOMParser() .parseFromString( `