-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc407d5
commit 0464a4b
Showing
12 changed files
with
230 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const e2eTestUrls = { | ||
github: { | ||
pr: 'https://github.com/microsoft/playwright/pull/20635', | ||
issue: 'https://github.com/microsoft/playwright/issues/20636', | ||
discussion: 'https://github.com/golang/go/discussions/61669', | ||
repo: 'https://github.com/microsoft/playwright', | ||
user: 'https://github.com/microsoft', | ||
release: 'https://github.com/microsoft/playwright/releases/tag/v1.32.3', | ||
commit: 'https://github.com/golang/go/commit/96d8ff00c2d6a88384863a656fb5e53716b614d3', | ||
actions: 'https://github.com/jonfriesen/quickcite/actions/runs/10446232111', | ||
}, | ||
instagram: { | ||
profile: 'https://www.instagram.com/jonfriesen/', | ||
}, | ||
trello: { | ||
board: 'https://trello.com/b/AwYSWOyt/ultimate-to-do-list', | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { runUrlPatternTests, runMarkdownGeneratorTests } from './testUtils' | ||
|
||
const urlPatternTestCases = [ | ||
{ page: 'pr', url: 'https://github.com/user/repo/pull/123', shouldMatch: true }, | ||
{ page: 'issue', url: 'https://github.com/user/repo/issues/456', shouldMatch: true }, | ||
{ page: 'discussion', url: 'https://github.com/user/repo/discussions/789', shouldMatch: true }, | ||
{ page: 'repo', url: 'https://github.com/user/repo', shouldMatch: true }, | ||
{ page: 'user', url: 'https://github.com/username', shouldMatch: true }, | ||
{ page: 'release', url: 'https://github.com/user/repo/releases/tag/v1.0.0', shouldMatch: true }, | ||
{ page: 'commit', url: 'https://github.com/user/repo/commit/1234567890123456789012345678901234567890', shouldMatch: true }, | ||
{ page: 'pr', url: 'https://github.com/user/repo', shouldMatch: false }, | ||
{ page: 'actions', url: 'https://github.com/jonfriesen/quickcite/actions/runs/10476888027', shouldMatch: true }, | ||
{ page: 'actions', url: 'https://github.com/octocat/Hello-World/actions/runs/12345678', shouldMatch: true }, | ||
{ page: 'actions', url: 'https://github.com/octocat/Hello-World/actions', shouldMatch: false }, | ||
{ page: 'actions', url: 'https://github.com/octocat/Hello-World/actions/runs/abcdefgh', shouldMatch: false }, | ||
{ page: 'actions', url: 'https://github.com/octocat/Hello-World/actions/runs/abcdefgh/job/12345678', shouldMatch: false }, | ||
] | ||
|
||
const markdownTestCases = [ | ||
{ | ||
page: 'pr', | ||
info: { number: '#123', title: 'Add new feature' }, | ||
url: 'https://github.com/user/repo/pull/123', | ||
expected: '[#123: Add new feature](https://github.com/user/repo/pull/123)', | ||
}, | ||
{ | ||
page: 'issue', | ||
info: { number: '#456', title: 'Fix bug in login' }, | ||
url: 'https://github.com/user/repo/issues/456', | ||
expected: '[#456: Fix bug in login](https://github.com/user/repo/issues/456)', | ||
}, | ||
{ | ||
page: 'discussion', | ||
info: { number: '#789', title: 'Propose new architecture' }, | ||
url: 'https://github.com/user/repo/discussions/789', | ||
expected: '[#789: Propose new architecture](https://github.com/user/repo/discussions/789)', | ||
}, | ||
{ | ||
page: 'repo', | ||
info: { title: 'user/repo', description: 'A cool project' }, | ||
url: 'https://github.com/user/repo', | ||
expected: '[user/repo](https://github.com/user/repo) - A cool project', | ||
}, | ||
{ | ||
page: 'user', | ||
info: { name: 'John Doe', bio: 'Software Developer' }, | ||
url: 'https://github.com/johndoe', | ||
expected: '[John Doe](https://github.com/johndoe) - Software Developer', | ||
}, | ||
{ | ||
page: 'release', | ||
info: { title: 'v1.0.0: First Release', date: '2023-05-01T00:00:00Z' }, | ||
url: 'https://github.com/user/repo/releases/tag/v1.0.0', | ||
expected: '[v1.0.0: First Release](https://github.com/user/repo/releases/tag/v1.0.0) - Released on ' + new Date('2023-05-01T00:00:00Z').toLocaleDateString(), | ||
}, | ||
{ | ||
page: 'commit', | ||
info: { title: 'Update README.md', hash: '1234567890abcdef', author: 'John Doe', date: '2023-05-01T00:00:00Z' }, | ||
url: 'https://github.com/user/repo/commit/1234567890abcdef', | ||
expected: '[(1234567) - Update README.md](https://github.com/user/repo/commit/1234567890abcdef)\nBy John Doe on ' + new Date('2023-05-01T00:00:00Z').toLocaleString(), | ||
}, | ||
{ | ||
page: 'actions', | ||
info: { repoOwner: 'jonfriesen', repoName: 'quickcite', workflowName: 'CI', runNumber: '#1234', runStatus: 'Success', statusEmoji: '✅' }, | ||
url: 'https://github.com/jonfriesen/quickcite/actions/runs/10476888027', | ||
expected: '[jonfriesen/quickcite: CI #1234 ✅ (Success)](https://github.com/jonfriesen/quickcite/actions/runs/10476888027)', | ||
}, | ||
{ | ||
page: 'actions', | ||
info: { repoOwner: 'octocat', repoName: 'Hello-World', workflowName: 'Build', runNumber: '#5678', runStatus: 'Failure', statusEmoji: '❌' }, | ||
url: 'https://github.com/octocat/Hello-World/actions/runs/12345678', | ||
expected: '[octocat/Hello-World: Build #5678 ❌ (Failure)](https://github.com/octocat/Hello-World/actions/runs/12345678)', | ||
}, | ||
{ | ||
page: 'actions', | ||
info: { repoOwner: 'test', repoName: 'repo', workflowName: 'Deploy', runNumber: '#9012', runStatus: 'In progress', statusEmoji: '🔄' }, | ||
url: 'https://github.com/test/repo/actions/runs/90123456', | ||
expected: '[test/repo: Deploy #9012 🔄 (In progress)](https://github.com/test/repo/actions/runs/90123456)', | ||
}, | ||
] | ||
|
||
runUrlPatternTests('github', urlPatternTestCases) | ||
runMarkdownGeneratorTests('github', markdownTestCases) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { runUrlPatternTests, runMarkdownGeneratorTests } from './testUtils' | ||
|
||
const urlPatternTestCases = [ | ||
{ page: 'profile', url: 'https://www.instagram.com/username/', shouldMatch: true }, | ||
{ page: 'profile', url: 'https://www.instagram.com/p/123456/', shouldMatch: false }, | ||
] | ||
|
||
const markdownTestCases = [ | ||
{ | ||
page: 'profile', | ||
info: { name: 'Travel Enthusiast' }, | ||
url: 'https://www.instagram.com/travelenthusiast/', | ||
expected: '[Travel Enthusiast](https://www.instagram.com/travelenthusiast/)', | ||
}, | ||
] | ||
|
||
runUrlPatternTests('instagram', urlPatternTestCases) | ||
runMarkdownGeneratorTests('instagram', markdownTestCases) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { runUrlPatternTests, runMarkdownGeneratorTests } from './testUtils' | ||
|
||
const urlPatternTestCases = [ | ||
{ page: 'profile', url: 'https://www.linkedin.com/in/username/', shouldMatch: true }, | ||
{ page: 'company', url: 'https://www.linkedin.com/company/companyname/', shouldMatch: true }, | ||
{ page: 'pulse', url: 'https://www.linkedin.com/pulse/article-title/', shouldMatch: true }, | ||
{ page: 'profile', url: 'https://www.linkedin.com/feed/', shouldMatch: false }, | ||
] | ||
|
||
const markdownTestCases = [ | ||
{ | ||
page: 'profile', | ||
info: { name: 'John Doe', headline: 'Software Engineer' }, | ||
url: 'https://www.linkedin.com/in/johndoe/', | ||
expected: '[John Doe](https://www.linkedin.com/in/johndoe/) - Software Engineer', | ||
}, | ||
{ | ||
page: 'company', | ||
info: { name: 'Tech Corp', about: 'Leading technology company' }, | ||
url: 'https://www.linkedin.com/company/techcorp/', | ||
expected: '[Tech Corp](https://www.linkedin.com/company/techcorp/) - Leading technology company', | ||
}, | ||
{ | ||
page: 'pulse', | ||
info: { title: 'The Future of AI', author: 'Jane Smith', date: 'May 1, 2023' }, | ||
url: 'https://www.linkedin.com/pulse/future-ai-jane-smith/', | ||
expected: '[The Future of AI](https://www.linkedin.com/pulse/future-ai-jane-smith/)\nBy Jane Smith | May 1, 2023', | ||
}, | ||
] | ||
|
||
runUrlPatternTests('linkedin', urlPatternTestCases) | ||
runMarkdownGeneratorTests('linkedin', markdownTestCases) |
Oops, something went wrong.