Skip to content

Commit

Permalink
fix(add-content): extend webpage check for RSS feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadUmer44 committed Sep 18, 2024
1 parent 7fdc308 commit 9179ede
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/AddContentModal/utils/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@ describe('youtubeRegex', () => {
})

it('should assert we can check for generic url regex', async () => {
global.fetch = jest.fn(() =>
Promise.resolve({
headers: {
get: (header) => (header === 'Content-Type' ? 'text/html' : null),
},
}),
) as jest.Mock

await expect(getInputType('https://idkwhat.com/routeing/tou')).resolves.toBe(WEB_PAGE)

jest.restoreAllMocks()
})

it('should assert we can check for youtube clip regex', async () => {
Expand Down

0 comments on commit 9179ede

Please sign in to comment.