From 9179ede2b556e12fc2a22ca888459c9449f79b5c Mon Sep 17 00:00:00 2001 From: MuhammadUmer44 Date: Wed, 18 Sep 2024 21:48:08 +0500 Subject: [PATCH] fix(add-content): extend webpage check for RSS feeds --- .../AddContentModal/utils/__tests__/index.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/AddContentModal/utils/__tests__/index.ts b/src/components/AddContentModal/utils/__tests__/index.ts index 0ca2cb958..853276372 100644 --- a/src/components/AddContentModal/utils/__tests__/index.ts +++ b/src/components/AddContentModal/utils/__tests__/index.ts @@ -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 () => {