-
Notifications
You must be signed in to change notification settings - Fork 295
fix(webview-message-handler): enforce workspace containment for markdown-sourced openFile requests #1762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(webview-message-handler): enforce workspace containment for markdown-sourced openFile requests #1762
Changes from all commits
c607864
e98713a
0d393fd
ceff8bf
3570b70
d4d63d4
1c076f0
7f3668d
e182070
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| // npx vitest i18n/__tests__/locale-bundles.spec.ts | ||
| // | ||
| // The i18n setup loads locale bundles from disk outside the test environment, | ||
| // so no other suite imports the bundle files. This spec imports every bundle | ||
| // directly: it pins the completeness of the keys this unit adds, and it puts | ||
| // the bundle files into the coverage report so changed-line coverage can | ||
| // measure them. | ||
|
|
||
| import { describe, it, expect } from "vitest" | ||
| import ca from "../locales/ca/common.json" | ||
| import de from "../locales/de/common.json" | ||
| import en from "../locales/en/common.json" | ||
| import es from "../locales/es/common.json" | ||
| import fr from "../locales/fr/common.json" | ||
| import hi from "../locales/hi/common.json" | ||
| import id from "../locales/id/common.json" | ||
| import itBundle from "../locales/it/common.json" | ||
| import ja from "../locales/ja/common.json" | ||
| import ko from "../locales/ko/common.json" | ||
| import nl from "../locales/nl/common.json" | ||
| import pl from "../locales/pl/common.json" | ||
| import ptBr from "../locales/pt-BR/common.json" | ||
| import ru from "../locales/ru/common.json" | ||
| import tr from "../locales/tr/common.json" | ||
| import vi from "../locales/vi/common.json" | ||
| import zhCn from "../locales/zh-CN/common.json" | ||
| import zhTw from "../locales/zh-TW/common.json" | ||
|
|
||
| const bundles: Record<string, { errors: Record<string, unknown> }> = { | ||
| ca, | ||
| de, | ||
| en, | ||
| es, | ||
| fr, | ||
| hi, | ||
| id, | ||
| it: itBundle, | ||
| ja, | ||
| ko, | ||
| nl, | ||
| pl, | ||
| "pt-BR": ptBr, | ||
| ru, | ||
| tr, | ||
| vi, | ||
| "zh-CN": zhCn, | ||
| "zh-TW": zhTw, | ||
| } | ||
|
|
||
| // Keys this unit adds to the common namespace (the openFile workspace | ||
| // containment error posted by webviewMessageHandler). | ||
| const addedKeys = ["path_outside_workspace"] | ||
|
|
||
| describe("common locale bundles", () => { | ||
| it.each(Object.keys(bundles))("%s defines every key this unit adds", (locale) => { | ||
| for (const key of addedKeys) { | ||
| expect(bundles[locale].errors[key]).toEqual(expect.any(String)) | ||
| } | ||
| }) | ||
| }) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.