Skip to content

Commit 8e86f31

Browse files
authored
expand the corpus (#58 to help with #23 and #50)
2 parents e26be70 + a83c1b2 commit 8e86f31

File tree

11 files changed

+15129
-11
lines changed

11 files changed

+15129
-11
lines changed

browser-extension/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ We maintain a corpus of test pages in two formats for testing the browser extens
8484
- `npx playwright codegen https://github.com/login --save-storage=playwright/.auth/gh.json` will store new auth tokens
8585
- login manually, then close the browser
8686
- ***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!***
87-
- `pnpm run corpus:record:har` records new HAR files using those auth tokens (it needs args, run it with no args for docs)
87+
- `pnpm run corpus:har:record` records new HAR files using those auth tokens (it needs args, run it with no args for docs)
8888
- DO NOT COMMIT AND PUSH NEW OR CHANGED HAR files!
89-
- we try to sanitize these (see `har-record.ts` for details) but there may be important PII in them
89+
- we try to sanitize these (see `corpus-har-record.ts` for details) but there may be important PII in them
9090
- if you need new HAR files for something, let us know and we will generate them ourselves using a dummy account
9191
- 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.
9292

browser-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"test": "vitest run",
6363
"playground": "vite --config vite.playground.config.ts",
6464
"playground:build": "vite build --config vite.playground.config.ts",
65-
"corpus:record:har": "tsx tests/har-record.ts",
65+
"corpus:har:record": "tsx tests/corpus-har-record.ts",
6666
"corpus:view": "tsx tests/corpus-view.ts"
6767
},
6868
"type": "module",

browser-extension/tests/har-record.ts renamed to browser-extension/tests/corpus-har-record.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function stripHeaders(headers?: any[]) {
6565
async function sanitize(filename: string) {
6666
console.log('Sanitizing:', filename)
6767

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

7171
for (const e of har.log?.entries ?? []) {

browser-extension/tests/corpus/_corpus-index.ts

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export const CORPUS: Record<string, CorpusEntry> = {
1212
type: 'har',
1313
url: 'https://github.com/diffplug/selfie/issues/523',
1414
},
15+
gh_issue_edit: {
16+
description: 'editing an existing comment on an issue',
17+
type: 'html',
18+
url: 'https://github.com/diffplug/gitcasso/issues/56',
19+
},
1520
gh_issue_populated_comment: {
1621
description: 'comment text box has some text',
1722
type: 'html',
@@ -29,11 +34,33 @@ export const CORPUS: Record<string, CorpusEntry> = {
2934
type: 'har',
3035
url: 'https://github.com/diffplug/selfie/pull/517',
3136
},
32-
// HTML corpus (captured after user interactions via SingleFile)
33-
// Add new entries here as needed, e.g.:
34-
// gh_issue_with_comment_preview: {
35-
// url: 'https://github.com/diffplug/selfie/issues/523',
36-
// type: 'html',
37-
// description: 'Issue page with comment textarea expanded and preview tab active'
38-
// }
37+
gh_pr_edit: {
38+
description: 'editing an existing comment on a PR',
39+
type: 'html',
40+
url: 'https://github.com/diffplug/gitcasso/pull/58',
41+
},
42+
gh_project: {
43+
description: 'github project board initial load',
44+
type: 'html',
45+
url: 'https://github.com/orgs/diffplug/projects/12',
46+
},
47+
gh_project_draft: {
48+
type: 'html',
49+
url: 'https://github.com/orgs/diffplug/projects/12/views/1?pane=issue&itemId=129503329',
50+
},
51+
gh_project_draft_edit: {
52+
description: 'editing an existing comment on a draft issue within a project',
53+
type: 'html',
54+
url: 'https://github.com/orgs/diffplug/projects/12/views/1?pane=issue&itemId=129503329',
55+
},
56+
gh_project_issue: {
57+
description: 'github project board issue add comment',
58+
type: 'html',
59+
url: 'https://github.com/orgs/diffplug/projects/12/views/1?pane=issue&itemId=129503239&issue=diffplug%7Cgitcasso%7C57',
60+
},
61+
gh_project_issue_edit: {
62+
description: 'editing an existing comment on a issue within a project',
63+
type: 'html',
64+
url: 'https://github.com/orgs/diffplug/projects/12/views/1?pane=issue&itemId=129503239&issue=diffplug%7Cgitcasso%7C57',
65+
},
3966
} as const

browser-extension/tests/corpus/gh_issue_edit.html

Lines changed: 1529 additions & 0 deletions
Large diffs are not rendered by default.

browser-extension/tests/corpus/gh_pr_edit.html

Lines changed: 5967 additions & 0 deletions
Large diffs are not rendered by default.

browser-extension/tests/corpus/gh_project.html

Lines changed: 1519 additions & 0 deletions
Large diffs are not rendered by default.

browser-extension/tests/corpus/gh_project_draft.html

Lines changed: 1519 additions & 0 deletions
Large diffs are not rendered by default.

browser-extension/tests/corpus/gh_project_draft_edit.html

Lines changed: 1519 additions & 0 deletions
Large diffs are not rendered by default.

browser-extension/tests/corpus/gh_project_issue.html

Lines changed: 1519 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)