From 1f01cf9de5435e80658943e17db0f759400526f7 Mon Sep 17 00:00:00 2001 From: Mirza Hanan Date: Thu, 19 Sep 2024 17:31:49 +0500 Subject: [PATCH] fix(add-content): unit test --- .../AddContentModal/utils/__tests__/index.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/AddContentModal/utils/__tests__/index.ts b/src/components/AddContentModal/utils/__tests__/index.ts index 39ef6c0683..70fa7855d5 100644 --- a/src/components/AddContentModal/utils/__tests__/index.ts +++ b/src/components/AddContentModal/utils/__tests__/index.ts @@ -1,4 +1,13 @@ -import { DOCUMENT, LINK, RSS, TWITTER_HANDLE, TWITTER_SOURCE, WEB_PAGE, YOUTUBE_CHANNEL } from '~/constants' +import { + DOCUMENT, + GITHUB_REPOSITORY, + LINK, + RSS, + TWITTER_HANDLE, + TWITTER_SOURCE, + WEB_PAGE, + YOUTUBE_CHANNEL, +} from '~/constants' import { extractNameFromLink, getInputType } from '..' describe('youtubeRegex', () => { @@ -61,6 +70,10 @@ describe('youtubeRegex', () => { it('should assert we can check for document regex', async () => { expect(getInputType('some plain text')).toBe(DOCUMENT) }) + + it('should assert we can check for GitHub repository regex', async () => { + expect(getInputType('https://github.com/stakwork/sphinx-nav-fiber')).toBe(GITHUB_REPOSITORY) + }) }) describe('extractNameFromLink', () => {