MCPcopy Create free account
hub / github.com/dailydotdev/apps / createTestSettings

Function createTestSettings

packages/shared/__tests__/fixture/settings.ts:5–53  ·  view source on GitHub ↗
(
  props: Partial<SettingsContextData> = {},
)

Source from the content-addressed store, hash-verified

3import { SortCommentsBy } from '../../src/graphql/comments';
4
5export const createTestSettings = (
6 props: Partial<SettingsContextData> = {},
7): SettingsContextData => ({
8 spaciness: 'eco',
9 openNewTab: true,
10 setTheme: jest.fn(),
11 themeMode: ThemeMode.Dark,
12 setSpaciness: jest.fn(),
13 toggleOpenNewTab: jest.fn(),
14 insaneMode: false,
15 loadedSettings: true,
16 toggleInsaneMode: jest.fn(),
17 showTopSites: true,
18 toggleShowTopSites: jest.fn(),
19 autoDismissNotifications: true,
20 optOutCompanion: true,
21 optOutReadingStreak: true,
22 optOutStreakFreeze: false,
23 toggleOptOutStreakFreeze: jest.fn(),
24 optOutLevelSystem: false,
25 optOutQuestSystem: false,
26 optOutAchievements: false,
27 isGamificationEnabled: true,
28 toggleOptOutAchievements: jest.fn(),
29 toggleAllGamification: jest.fn(),
30 sidebarExpanded: true,
31 companionExpanded: true,
32 sortingEnabled: true,
33 sortCommentsBy: SortCommentsBy.OldestFirst,
34 showFeedbackButton: true,
35 toggleShowFeedbackButton: jest.fn(),
36 toggleAutoDismissNotifications: jest.fn(),
37 toggleOptOutCompanion: jest.fn(),
38 toggleOptOutReadingStreak: jest.fn(),
39 toggleOptOutLevelSystem: jest.fn(),
40 toggleOptOutQuestSystem: jest.fn(),
41 toggleSidebarExpanded: jest.fn(),
42 toggleSortingEnabled: jest.fn(),
43 syncSettings: jest.fn(),
44 updateCustomLinks: jest.fn(),
45 updateSortCommentsBy: jest.fn(),
46 updateFlag: jest.fn(),
47 updateFlagRemote: jest.fn(),
48 updatePromptFlag: jest.fn(),
49 onToggleHeaderPlacement: jest.fn(),
50 setSettings: jest.fn(),
51 applyThemeMode: jest.fn(),
52 ...props,
53});
54
55export const defaultTestSettings: SettingsContextData = createTestSettings();
56

Callers 3

renderComponentFunction · 0.90
renderPostFunction · 0.90
settings.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected