-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Vitest followup: switch to happy-dom, cleanup/fixes to mocks #21359
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
18 commits
Select commit
Hold shift + click to select a range
5dcd370
Consolidate test mocks and remove unused ones
dannon 9646660
Update tests to use shared config mock
dannon b762b34
Consolidate 6 more tests to use shared config mock
dannon 6af97f4
Switch from jsdom to happy-dom for test environment
dannon 944eeae
Fix malformed CSS selectors in tests
dannon 82f0d37
Add ResizeObserver mock for happy-dom compatibility
dannon 85cbbef
Spoof jsdom in user agent for BootstrapVue compatibility
dannon 48990e7
Fix test assertions for happy-dom compatibility
dannon b371c31
Fix import ordering
dannon aca9f49
Mock workflow counts API in WorkflowList test
dannon 0416717
Suppress KaTeX quirks mode warning and add doctype
dannon 82fe109
Remove jsdom packages, now using happy-dom
dannon 066dc35
Remove unnecessary scrollIntoView mock (happy-dom supports it)
dannon fe5b3ff
Remove unnecessary observer mocks (happy-dom supports them)
dannon a1714ae
Remove unnecessary polyfills and mock KaTeX
dannon a1e3b58
Remove outdated jsdom reference from test comment
dannon 2f6b049
Update ro-crate-zip-explorer to 0.4.1 (fixes sourcemap warnings)
dannon 6827d43
Extract default config to const to avoid duplication
dannon 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 was deleted.
Oops, something went wrong.
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
6 changes: 1 addition & 5 deletions
6
client/src/components/TagsMultiselect/HeadlessMultiselect.test.ts
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
3 changes: 0 additions & 3 deletions
3
client/src/components/Workflow/Run/__mocks__/WorkflowRunSuccess.vue
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
| import { vi } from "vitest"; | ||
| import { ref } from "vue"; | ||
|
|
||
| // Default mock config values | ||
| const defaultConfig = { | ||
| allow_local_account_creation: true, | ||
| enable_oidc: false, | ||
| mailing_join_addr: "", | ||
| prefer_custos_login: false, | ||
| registration_warning_message: "", | ||
| server_mail_configured: false, | ||
| show_welcome_with_login: false, | ||
| terms_url: "", | ||
| welcome_url: "", | ||
| citation_bibtex: "", | ||
| toolbox_auto_sort: false, | ||
|
dannon marked this conversation as resolved.
|
||
| }; | ||
|
|
||
| const mockConfig = ref({ ...defaultConfig }); | ||
|
|
||
| export const useConfig = vi.fn(() => ({ | ||
| config: mockConfig, | ||
| isConfigLoaded: true, | ||
| })); | ||
|
|
||
| // Helper function for tests to override config values | ||
| export function setMockConfig(config: Record<string, any>) { | ||
| mockConfig.value = { ...mockConfig.value, ...config }; | ||
| } | ||
|
|
||
| // Helper function to reset config to defaults | ||
| export function resetMockConfig() { | ||
| mockConfig.value = { ...defaultConfig }; | ||
| } | ||
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
Oops, something went wrong.
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.