diff --git a/src/matchers/feed.js b/src/matchers/feed.js index 96d4be27..50f8abfb 100644 --- a/src/matchers/feed.js +++ b/src/matchers/feed.js @@ -16,7 +16,7 @@ const parser = new Parser(); module.exports = { required: [], pattern: (url) => { - if (/[&?]feed=atom/.test(url)) { + if (/\/feeds\/|[&?]feed=atom/.test(url)) { return true; } return false; diff --git a/test/feed.test.js b/test/feed.test.js index 6e3838f6..7b04b0db 100644 --- a/test/feed.test.js +++ b/test/feed.test.js @@ -16,17 +16,17 @@ const { main } = require('../src/index'); describe('Feed Tests', () => { it('Works for RSS Feeds', async () => { const result = await main({ - __ow_path: '/https://blogs.adobe.com/psirt/', - __ow_query: 'feed=atom', + __ow_path: '/https://daringfireball.net/feeds/articles', + __ow_query: '', }); assert.equal(result.statusCode, 200); - assert.equal(result.body.length, 10); + assert.ok(result.body.length > 1); }).timeout(10000); it('Works for RSS Feeds with Limits', async () => { const result = await main({ - __ow_path: '/https://blogs.adobe.com/psirt/', - __ow_query: 'feed=atom&hlx_p.limit=1', + __ow_path: '/https://daringfireball.net/feeds/main', + __ow_query: 'hlx_p.limit=1', }); assert.equal(result.statusCode, 200); assert.equal(result.body.length, 1); diff --git a/test/post-deploy.test.js b/test/post-deploy.test.js index 24749168..5ff63d43 100644 --- a/test/post-deploy.test.js +++ b/test/post-deploy.test.js @@ -35,10 +35,10 @@ describe('Post-Deploy Tests', () => { it('RSS Embed', async () => { await chai .request('https://adobeioruntime.net/') - .get(`${getbaseurl()}/https://blogs.adobe.com/psirt/?feed=atom`) + .get(`${getbaseurl()}/https://daringfireball.net/feeds/main`) .then((response) => { expect(response).to.be.json; - expect(response.body).to.be.an('array').that.has.length(10); + expect(response.body).to.be.an('array'); expect(response).to.have.status(200); }).catch((e) => { throw e; @@ -46,18 +46,17 @@ describe('Post-Deploy Tests', () => { }).timeout(10000); it('Excel Embed', async () => { - console.log('Trying', `https://adobeioruntime.net/${getbaseurl()}/https://adobe.sharepoint.com/sites/TheBlog/_layouts/15/guestaccess.aspx?share=ESR1N29Z7HpCh1Zfs_0YS_gB4gVSuKyWRut-kNcHVSvkew&email=helix%40adobe.com&e=hx0OUl`); + console.log('Trying', 'https://adobe-my.sharepoint.com/personal/trieloff_adobe_com/_layouts/15/guestaccess.aspx?share=Edoi88tLKLpDsKzSfL-pcJYB2lIo7UKooYWnjm3w2WRrsA&email=helix%40adobe.com&e=tD623x'); await chai .request('https://adobeioruntime.net/') - .get(`${getbaseurl()}/https://adobe.sharepoint.com/sites/TheBlog/_layouts/15/guestaccess.aspx?share=ESR1N29Z7HpCh1Zfs_0YS_gB4gVSuKyWRut-kNcHVSvkew&email=helix%40adobe.com&e=hx0OUl`) + .get(`${getbaseurl()}/https://adobe-my.sharepoint.com/personal/trieloff_adobe_com/_layouts/15/guestaccess.aspx?share=Edoi88tLKLpDsKzSfL-pcJYB2lIo7UKooYWnjm3w2WRrsA&email=helix%40adobe.com&e=tD623x`) .then((response) => { // console.log(response.body); expect(response).to.be.json; expect(response.body).to.be.an('array').that.deep.includes({ - 'import date': '2020-04-23T12:55:40.852Z', - url: 'https://theblog.adobe.com/best-practices-in-content-management-it-edition/', - year: 43875, + project: 'Helix', + created: 2018, }); expect(response).to.have.status(200); }).catch((e) => {