Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions src/__mocks__/state-mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
42 changes: 27 additions & 15 deletions src/context/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down