diff options
author | 2023-03-13 17:34:23 -0400 | |
---|---|---|
committer | 2023-03-13 17:34:23 -0400 | |
commit | 400ef26c998a586b29c2f3931e63c1c5801d3bea (patch) | |
tree | cba2b363f228f29f35f4123a8a63716a1d8a1b1d /packages/astro-rss/test/rss.test.js | |
parent | 43daac7a9b4cc793369bbeb3f722f8de9d8f64c8 (diff) | |
download | astro-400ef26c998a586b29c2f3931e63c1c5801d3bea.tar.gz astro-400ef26c998a586b29c2f3931e63c1c5801d3bea.tar.zst astro-400ef26c998a586b29c2f3931e63c1c5801d3bea.zip |
[RSS] Fix: Preserve self-closing tags in `customData` (#6538)
* fix: preserve self-closing tags in customData
* test: self-closing tags preserved
* chore: changeset
Diffstat (limited to 'packages/astro-rss/test/rss.test.js')
-rw-r--r-- | packages/astro-rss/test/rss.test.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/astro-rss/test/rss.test.js b/packages/astro-rss/test/rss.test.js index d519d19ca..be4362a34 100644 --- a/packages/astro-rss/test/rss.test.js +++ b/packages/astro-rss/test/rss.test.js @@ -92,6 +92,23 @@ describe('rss', () => { chai.expect(body).xml.to.equal(validXmlWithXSLStylesheet); }); + it('should preserve self-closing tags on `customData`', async () => { + const customData = + '<atom:link href="https://example.com/feed.xml" rel="self" type="application/rss+xml"/>'; + const { body } = await rss({ + title, + description, + items: [], + site, + xmlns: { + atom: 'http://www.w3.org/2005/Atom', + }, + customData, + }); + + chai.expect(body).to.contain(customData); + }); + it('should filter out entries marked as `draft`', async () => { const { body } = await rss({ title, |