Skip to content

Commit

Permalink
fix(add-content): unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
MirzaHanan committed Sep 19, 2024
1 parent e052889 commit b30b4b8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/AddContentModal/utils/__tests__/index.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit b30b4b8

Please sign in to comment.