From fedb40603459d173135c3cc165a3e86f0e1abb66 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 28 Sep 2024 10:11:02 +0200 Subject: Use more natural path to feeds --- exampleSite/config/_default/config.yaml | 9 +++------ tests/feed-atom.spec.js | 6 +++--- tests/feed-rss.spec.js | 7 +++---- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/exampleSite/config/_default/config.yaml b/exampleSite/config/_default/config.yaml index 7997d9f..5adea78 100644 --- a/exampleSite/config/_default/config.yaml +++ b/exampleSite/config/_default/config.yaml @@ -47,8 +47,8 @@ outputFormats: # will cause the feed to be parsed correctly by most clients. # Note that you should be encoding your feed in UTF-8. mediaType: text/xml - # generated file = . = feeds/feed.atom.xml - baseName: feeds/feed.atom + # generated file = . = atom.xml + baseName: atom rel: alternate isPlainText: false isHTML: false @@ -59,7 +59,7 @@ outputFormats: JSONFEED: name: JsonFeed mediaType: application/feed+json - baseName: feeds/feed + baseName: feed rel: alternate isPlainText: true isHTML: false @@ -98,9 +98,6 @@ mediaTypes: application/feed+json: suffixes: - json - application/manifest+json: - suffixes: - - webmanifest # Sitemap config sitemap: diff --git a/tests/feed-atom.spec.js b/tests/feed-atom.spec.js index 4e62c2f..7a26a60 100644 --- a/tests/feed-atom.spec.js +++ b/tests/feed-atom.spec.js @@ -6,7 +6,7 @@ const jsdom = require('jsdom'); const { JSDOM } = jsdom; test('atom feed has correct updated field', async ({ page }) => { - await page.goto('/feeds/feed.atom.xml'); + await page.goto('/atom.xml'); // Get the content of the page const content = await page.content(); @@ -32,7 +32,7 @@ test('atom feed has correct updated field', async ({ page }) => { }); test('atom feed has correct author information', async ({ page }) => { - await page.goto('/feeds/feed.atom.xml'); + await page.goto('/atom.xml'); // Get the content of the page const content = await page.content(); @@ -71,7 +71,7 @@ test('atom feed has correct author information', async ({ page }) => { }); test('atom feed entries have correct published and updated fields', async ({ page }) => { - await page.goto('/feeds/feed.atom.xml'); + await page.goto('/atom.xml'); // Get the content of the page const content = await page.content(); diff --git a/tests/feed-rss.spec.js b/tests/feed-rss.spec.js index f9f36bb..de06da1 100644 --- a/tests/feed-rss.spec.js +++ b/tests/feed-rss.spec.js @@ -6,7 +6,7 @@ const jsdom = require('jsdom'); const { JSDOM } = jsdom; test('rss feed has correct lastBuildDate field', async ({ page }) => { - await page.goto('/feeds/feed.rss.xml'); + await page.goto('/rss.xml'); // Get the content of the page const content = await page.content(); @@ -32,7 +32,7 @@ test('rss feed has correct lastBuildDate field', async ({ page }) => { }); test('rss feed items have correct fields', async ({ page }) => { - await page.goto('/feeds/feed.rss.xml'); + await page.goto('/rss.xml'); // Get the content of the page const content = await page.content(); @@ -73,8 +73,7 @@ test('rss feed items have correct fields', async ({ page }) => { // Check for category element const categoryElement = item.querySelector('category'); - expect(categoryElement).not.toBeNull(); - expect(categoryElement.textContent.trim()).not.toBe(''); + expect(categoryElement).toBeNull(); // Check for guid element const guidElement = item.querySelector('guid'); -- cgit v1.2.3