Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions browser-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ We maintain a corpus of test pages in two formats for testing the browser extens
- `npx playwright codegen https://github.com/login --save-storage=playwright/.auth/gh.json` will store new auth tokens
- login manually, then close the browser
- ***these cookies are very sensitive! we only run this script using a test account that has no permissions or memberships to anything, recommend you do the same!***
- `pnpm run corpus:record:har` records new HAR files using those auth tokens (it needs args, run it with no args for docs)
- `pnpm run corpus:har:record` records new HAR files using those auth tokens (it needs args, run it with no args for docs)
- DO NOT COMMIT AND PUSH NEW OR CHANGED HAR files!
- we try to sanitize these (see `har-record.ts` for details) but there may be important PII in them
- we try to sanitize these (see `corpus-har-record.ts` for details) but there may be important PII in them
- if you need new HAR files for something, let us know and we will generate them ourselves using a dummy account
- IF YOUR PR CHANGES OR ADDS HAR FILES WE WILL CLOSE IT. Ask for HAR files and we'll be happy to generate clean ones you can test against.

Expand Down
2 changes: 1 addition & 1 deletion browser-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"test": "vitest run",
"playground": "vite --config vite.playground.config.ts",
"playground:build": "vite build --config vite.playground.config.ts",
"corpus:record:har": "tsx tests/har-record.ts",
"corpus:har:record": "tsx tests/corpus-har-record.ts",
"corpus:view": "tsx tests/corpus-view.ts"
},
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function stripHeaders(headers?: any[]) {
async function sanitize(filename: string) {
console.log('Sanitizing:', filename)

const p = path.join('tests/corpus/har', filename)
const p = path.join('tests/corpus', filename)
const har = JSON.parse(await fs.readFile(p, 'utf8'))

for (const e of har.log?.entries ?? []) {
Expand Down
41 changes: 34 additions & 7 deletions browser-extension/tests/corpus/_corpus-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export const CORPUS: Record<string, CorpusEntry> = {
type: 'har',
url: 'https://github.com/diffplug/selfie/issues/523',
},
gh_issue_edit: {
description: 'editing an existing comment on an issue',
type: 'html',
url: 'https://github.com/diffplug/gitcasso/issues/56',
},
gh_issue_populated_comment: {
description: 'comment text box has some text',
type: 'html',
Expand All @@ -29,11 +34,33 @@ export const CORPUS: Record<string, CorpusEntry> = {
type: 'har',
url: 'https://github.com/diffplug/selfie/pull/517',
},
// HTML corpus (captured after user interactions via SingleFile)
// Add new entries here as needed, e.g.:
// gh_issue_with_comment_preview: {
// url: 'https://github.com/diffplug/selfie/issues/523',
// type: 'html',
// description: 'Issue page with comment textarea expanded and preview tab active'
// }
gh_pr_edit: {
description: 'editing an existing comment on a PR',
type: 'html',
url: 'https://github.com/diffplug/gitcasso/pull/58',
},
gh_project: {
description: 'github project board initial load',
type: 'html',
url: 'https://github.com/orgs/diffplug/projects/12',
},
gh_project_draft: {
type: 'html',
url: 'https://github.com/orgs/diffplug/projects/12/views/1?pane=issue&itemId=129503329',
},
gh_project_draft_edit: {
description: 'editing an existing comment on a draft issue within a project',
type: 'html',
url: 'https://github.com/orgs/diffplug/projects/12/views/1?pane=issue&itemId=129503329',
},
gh_project_issue: {
description: 'github project board issue add comment',
type: 'html',
url: 'https://github.com/orgs/diffplug/projects/12/views/1?pane=issue&itemId=129503239&issue=diffplug%7Cgitcasso%7C57',
},
gh_project_issue_edit: {
description: 'editing an existing comment on a issue within a project',
type: 'html',
url: 'https://github.com/orgs/diffplug/projects/12/views/1?pane=issue&itemId=129503239&issue=diffplug%7Cgitcasso%7C57',
},
} as const
1,529 changes: 1,529 additions & 0 deletions browser-extension/tests/corpus/gh_issue_edit.html

Large diffs are not rendered by default.

5,967 changes: 5,967 additions & 0 deletions browser-extension/tests/corpus/gh_pr_edit.html

Large diffs are not rendered by default.

1,519 changes: 1,519 additions & 0 deletions browser-extension/tests/corpus/gh_project.html

Large diffs are not rendered by default.

1,519 changes: 1,519 additions & 0 deletions browser-extension/tests/corpus/gh_project_draft.html

Large diffs are not rendered by default.

1,519 changes: 1,519 additions & 0 deletions browser-extension/tests/corpus/gh_project_draft_edit.html

Large diffs are not rendered by default.

1,519 changes: 1,519 additions & 0 deletions browser-extension/tests/corpus/gh_project_issue.html

Large diffs are not rendered by default.

1,519 changes: 1,519 additions & 0 deletions browser-extension/tests/corpus/gh_project_issue_edit.html

Large diffs are not rendered by default.