diff --git a/src/__mocks__/state-mocks.ts b/src/__mocks__/state-mocks.ts index 9885f0b10..9878894e6 100644 --- a/src/__mocks__/state-mocks.ts +++ b/src/__mocks__/state-mocks.ts @@ -71,26 +71,42 @@ export const mockAuth: AuthState = { export const mockToken = 'token-123-456' as Token; -export const mockSettings: SettingsState = { - participating: false, - playSound: true, - showNotifications: true, - hideBots: false, - showNotificationsCountInTray: false, - openAtStartup: false, +const mockApperanceSettings = { theme: Theme.SYSTEM, zoomPercentage: 100, detailedNotifications: true, - markAsDoneOnOpen: false, - showAccountHostname: false, - delayNotificationState: false, showPills: true, showNumber: true, - keyboardShortcut: true, + showAccountHostname: false, +}; + +const mockNotificationSettings = { groupBy: GroupBy.REPOSITORY, + participating: false, + markAsDoneOnOpen: false, + delayNotificationState: false, +}; + +const mockSystemSettings = { + keyboardShortcut: true, + showNotificationsCountInTray: false, + showNotifications: true, + playSound: true, + openAtStartup: false, +}; + +const mockFilters = { + hideBots: false, filterReasons: [], }; +export const mockSettings: SettingsState = { + ...mockApperanceSettings, + ...mockNotificationSettings, + ...mockSystemSettings, + ...mockFilters, +}; + export const mockState: GitifyState = { auth: mockAuth, settings: mockSettings, diff --git a/src/context/App.tsx b/src/context/App.tsx index adbcf1e5b..4b68d5f20 100644 --- a/src/context/App.tsx +++ b/src/context/App.tsx @@ -52,27 +52,39 @@ const defaultAuth: AuthState = { user: null, }; -export const defaultFilters = { - hideBots: false, - filterReasons: [], -}; - -export const defaultSettings: SettingsState = { - participating: false, - playSound: true, - showNotifications: true, - showNotificationsCountInTray: false, - openAtStartup: false, +const defaultApperanceSettings = { theme: Theme.SYSTEM, zoomPercentage: 100, detailedNotifications: true, - markAsDoneOnOpen: false, - showAccountHostname: false, - delayNotificationState: false, showPills: true, showNumber: true, - keyboardShortcut: true, + showAccountHostname: false, +}; + +const defaultNotificationSettings = { groupBy: GroupBy.REPOSITORY, + participating: false, + markAsDoneOnOpen: false, + delayNotificationState: false, +}; + +const defaultSystemSettings = { + keyboardShortcut: true, + showNotificationsCountInTray: false, + showNotifications: true, + playSound: true, + openAtStartup: false, +}; + +export const defaultFilters = { + hideBots: false, + filterReasons: [], +}; + +export const defaultSettings: SettingsState = { + ...defaultApperanceSettings, + ...defaultNotificationSettings, + ...defaultSystemSettings, ...defaultFilters, };