Skip to content
This repository was archived by the owner on Feb 25, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/matchers/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions test/feed.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 6 additions & 7 deletions test/post-deploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,28 @@ 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;
});
}).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) => {
Expand Down