-
Notifications
You must be signed in to change notification settings - Fork 141
fix(prividium): route page-load failures to a privacy-preserving not-found page #618
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8361903
fix(prividium): route 4xx page-load failures to a Prividium-aware not…
tomimor 7c08cc4
style: rephrase test comment without em dash
tomimor c03fbb3
style: drop noisy comments and trim test description
tomimor 875c147
test(block-view): stub router.resolve so the new useNotFoundView watc…
tomimor fe05944
Merge branch 'main' into fix/172-prividium-not-found
tomimor 2eba948
fix(prividium): only route 403/404 to not-found, keep error page for …
tomimor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,45 @@ | ||
| import { createI18n } from "vue-i18n"; | ||
|
|
||
| import { describe, expect, it, vi } from "vitest"; | ||
|
|
||
| import { mount } from "@vue/test-utils"; | ||
|
|
||
| import enUS from "@/locales/en.json"; | ||
|
|
||
| import $testId from "@/plugins/testId"; | ||
| import NotFound from "@/views/NotFound.vue"; | ||
|
|
||
| // SearchForm reaches into useContext / useSearch, so stub it out for this view test. | ||
| vi.mock("@/components/SearchForm.vue", () => ({ | ||
| default: { template: '<div data-testid="search-form-stub"></div>' }, | ||
| })); | ||
|
|
||
| const runtimeConfigMock = { appEnvironment: "default" as "default" | "prividium" }; | ||
| vi.mock("@/composables/useRuntimeConfig", () => ({ | ||
| default: () => runtimeConfigMock, | ||
| })); | ||
|
|
||
| function render() { | ||
| const i18n = createI18n({ | ||
| locale: "en", | ||
| allowComposition: true, | ||
| messages: { en: enUS }, | ||
| }); | ||
| return mount(NotFound, { global: { plugins: [i18n, $testId] } }); | ||
| } | ||
|
|
||
| describe("NotFound view", () => { | ||
| it("renders the default copy when appEnvironment is not prividium", () => { | ||
| runtimeConfigMock.appEnvironment = "default"; | ||
| const wrapper = render(); | ||
| expect(wrapper.find(".header").text()).toBe(enUS.notFound.title); | ||
| expect(wrapper.find(".description").text()).toBe(enUS.notFound.description); | ||
| }); | ||
|
|
||
| it("renders the prividium copy when appEnvironment is prividium", () => { | ||
| runtimeConfigMock.appEnvironment = "prividium"; | ||
| const wrapper = render(); | ||
| expect(wrapper.find(".header").text()).toBe(enUS.notFound.prividiumTitle); | ||
| expect(wrapper.find(".description").text()).toBe(enUS.notFound.prividiumDescription); | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.