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

Function createTestSettings

packages/shared/__tests__/fixture/settings.ts:5–59  ·  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 isRemoteSettingsLoaded: true,
17 toggleInsaneMode: jest.fn(),
18 showTopSites: true,
19 toggleShowTopSites: jest.fn(),
20 autoDismissNotifications: true,
21 optOutCompanion: true,
22 optOutReadingStreak: true,
23 optOutStreakFreeze: false,
24 toggleOptOutStreakFreeze: jest.fn(),
25 streakGoal: null,
26 updateStreakGoal: jest.fn(),
27 optOutLevelSystem: false,
28 optOutQuestSystem: false,
29 optOutAchievements: false,
30 isGamificationEnabled: true,
31 isQuestExperienceEnabled: true,
32 toggleOptOutAchievements: jest.fn(),
33 toggleAllGamification: jest.fn(),
34 toggleQuestExperience: jest.fn(),
35 sidebarExpanded: true,
36 companionExpanded: true,
37 sortingEnabled: true,
38 sortCommentsBy: SortCommentsBy.OldestFirst,
39 showFeedbackButton: true,
40 toggleShowFeedbackButton: jest.fn(),
41 toggleAutoDismissNotifications: jest.fn(),
42 toggleOptOutCompanion: jest.fn(),
43 toggleOptOutReadingStreak: jest.fn(),
44 toggleOptOutLevelSystem: jest.fn(),
45 toggleOptOutQuestSystem: jest.fn(),
46 toggleSidebarExpanded: jest.fn(),
47 setSidebarForceCollapsed: jest.fn(),
48 toggleSortingEnabled: jest.fn(),
49 syncSettings: jest.fn(),
50 updateCustomLinks: jest.fn(),
51 updateSortCommentsBy: jest.fn(),
52 updateFlag: jest.fn(),
53 updateFlagRemote: jest.fn(),
54 updatePromptFlag: jest.fn(),
55 onToggleHeaderPlacement: jest.fn(),
56 setSettings: jest.fn(),
57 applyThemeMode: jest.fn(),
58 ...props,
59});
60
61export const defaultTestSettings: SettingsContextData = createTestSettings();
62

Callers 4

treeFunction · 0.90
renderPageFunction · 0.90
renderComponentFunction · 0.90
settings.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected