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

Function createTestSettings

packages/shared/__tests__/fixture/settings.ts:5–47  ·  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 optOutLevelSystem: false,
23 optOutQuestSystem: false,
24 sidebarExpanded: true,
25 companionExpanded: true,
26 sortingEnabled: true,
27 sortCommentsBy: SortCommentsBy.OldestFirst,
28 showFeedbackButton: true,
29 toggleShowFeedbackButton: jest.fn(),
30 toggleAutoDismissNotifications: jest.fn(),
31 toggleOptOutCompanion: jest.fn(),
32 toggleOptOutReadingStreak: jest.fn(),
33 toggleOptOutLevelSystem: jest.fn(),
34 toggleOptOutQuestSystem: jest.fn(),
35 toggleSidebarExpanded: jest.fn(),
36 toggleSortingEnabled: jest.fn(),
37 syncSettings: jest.fn(),
38 updateCustomLinks: jest.fn(),
39 updateSortCommentsBy: jest.fn(),
40 updateFlag: jest.fn(),
41 updateFlagRemote: jest.fn(),
42 updatePromptFlag: jest.fn(),
43 onToggleHeaderPlacement: jest.fn(),
44 setSettings: jest.fn(),
45 applyThemeMode: jest.fn(),
46 ...props,
47});
48
49export const defaultTestSettings: SettingsContextData = createTestSettings();
50

Callers 3

renderComponentFunction · 0.90
renderPostFunction · 0.90
settings.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected