mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Extract default config to const to avoid duplication
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { vi } from "vitest";
|
||||
import { ref } from "vue";
|
||||
|
||||
// Default mock config values that tests can override
|
||||
const mockConfig = ref({
|
||||
// Default mock config values
|
||||
const defaultConfig = {
|
||||
allow_local_account_creation: true,
|
||||
enable_oidc: false,
|
||||
mailing_join_addr: "",
|
||||
@@ -14,7 +14,9 @@ const mockConfig = ref({
|
||||
welcome_url: "",
|
||||
citation_bibtex: "",
|
||||
toolbox_auto_sort: false,
|
||||
});
|
||||
};
|
||||
|
||||
const mockConfig = ref({ ...defaultConfig });
|
||||
|
||||
export const useConfig = vi.fn(() => ({
|
||||
config: mockConfig,
|
||||
@@ -28,17 +30,5 @@ export function setMockConfig(config: Record<string, any>) {
|
||||
|
||||
// Helper function to reset config to defaults
|
||||
export function resetMockConfig() {
|
||||
mockConfig.value = {
|
||||
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,
|
||||
};
|
||||
mockConfig.value = { ...defaultConfig };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user