Refactor workspace settings handling in tests and components to use currentWorkspace directly

This commit is contained in:
2025-07-06 00:41:30 +02:00
parent 7368797a11
commit cf554fbb6e
9 changed files with 25 additions and 73 deletions

View File

@@ -70,7 +70,6 @@ describe('ContentView', () => {
vi.mocked(useWorkspace).mockReturnValue({
currentWorkspace: mockCurrentWorkspace,
workspaces: [],
settings: mockCurrentWorkspace,
updateSettings: vi.fn(),
loading: false,
colorScheme: 'light',
@@ -88,7 +87,6 @@ describe('ContentView', () => {
vi.mocked(useWorkspace).mockReturnValue({
currentWorkspace: null,
workspaces: [],
settings: mockCurrentWorkspace,
updateSettings: vi.fn(),
loading: false,
colorScheme: 'light',

View File

@@ -9,7 +9,7 @@ import React from 'react';
import { MantineProvider } from '@mantine/core';
import MarkdownPreview from './MarkdownPreview';
import { notifications } from '@mantine/notifications';
import { Theme, DEFAULT_WORKSPACE_SETTINGS } from '../../types/models';
import { Theme } from '../../types/models';
// Mock notifications
vi.mock('@mantine/notifications', () => ({
@@ -70,7 +70,6 @@ describe('MarkdownPreview', () => {
lastOpenedFilePath: '',
},
workspaces: [],
settings: DEFAULT_WORKSPACE_SETTINGS,
updateSettings: vi.fn(),
loading: false,
colorScheme: 'light',
@@ -213,7 +212,6 @@ describe('MarkdownPreview', () => {
vi.mocked(useWorkspace).mockReturnValue({
currentWorkspace: null,
workspaces: [],
settings: DEFAULT_WORKSPACE_SETTINGS,
updateSettings: vi.fn(),
loading: false,
colorScheme: 'light',