Skip to content

Commit

Permalink
Merge 719d025 into 92471bf
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy authored May 21, 2024
2 parents 92471bf + 719d025 commit 5488bb2
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/__mocks__/mock-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const mockSettings: SettingsState = {
showNotificationsCountInTray: false,
openAtStartup: false,
theme: Theme.SYSTEM,
detailedNotifications: false,
detailedNotifications: true,
markAsDoneOnOpen: false,
showAccountHostname: false,
delayNotificationState: false,
Expand Down
4 changes: 2 additions & 2 deletions src/context/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ describe('context/App.tsx', () => {
showNotificationsCountInTray: false,
openAtStartup: false,
theme: 'SYSTEM',
detailedNotifications: false,
detailedNotifications: true,
markAsDoneOnOpen: false,
showAccountHostname: false,
delayNotificationState: false,
Expand Down Expand Up @@ -375,7 +375,7 @@ describe('context/App.tsx', () => {
showNotificationsCountInTray: false,
openAtStartup: true,
theme: 'SYSTEM',
detailedNotifications: false,
detailedNotifications: true,
markAsDoneOnOpen: false,
showAccountHostname: false,
delayNotificationState: false,
Expand Down
2 changes: 1 addition & 1 deletion src/context/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const defaultSettings: SettingsState = {
showNotificationsCountInTray: false,
openAtStartup: false,
theme: Theme.SYSTEM,
detailedNotifications: false,
detailedNotifications: true,
markAsDoneOnOpen: false,
showAccountHostname: false,
delayNotificationState: false,
Expand Down
20 changes: 16 additions & 4 deletions src/hooks/useNotifications.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ describe('hooks/useNotifications.ts', () => {
const { result } = renderHook(() => useNotifications());

act(() => {
result.current.fetchNotifications(mockAccounts, mockSettings);
result.current.fetchNotifications(mockAccounts, {
...mockSettings,
detailedNotifications: false,
});
});

expect(result.current.status).toBe('loading');
Expand Down Expand Up @@ -116,7 +119,10 @@ describe('hooks/useNotifications.ts', () => {
const { result } = renderHook(() => useNotifications());

act(() => {
result.current.fetchNotifications(accounts, mockSettings);
result.current.fetchNotifications(accounts, {
...mockSettings,
detailedNotifications: false,
});
});

await waitFor(() => {
Expand Down Expand Up @@ -179,7 +185,10 @@ describe('hooks/useNotifications.ts', () => {
const { result } = renderHook(() => useNotifications());

act(() => {
result.current.fetchNotifications(accounts, mockSettings);
result.current.fetchNotifications(accounts, {
...mockSettings,
detailedNotifications: false,
});
});

await waitFor(() => {
Expand Down Expand Up @@ -417,7 +426,10 @@ describe('hooks/useNotifications.ts', () => {
const { result } = renderHook(() => useNotifications());

act(() => {
result.current.fetchNotifications(mockAccounts, mockSettings);
result.current.fetchNotifications(mockAccounts, {
...mockSettings,
detailedNotifications: false,
});
});

await waitFor(() => {
Expand Down
5 changes: 4 additions & 1 deletion src/routes/Settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ describe('routes/Settings.tsx', () => {
fireEvent.click(screen.getByLabelText('Detailed notifications'));

expect(updateSetting).toHaveBeenCalledTimes(1);
expect(updateSetting).toHaveBeenCalledWith('detailedNotifications', true);
expect(updateSetting).toHaveBeenCalledWith(
'detailedNotifications',
false,
);
});
});

Expand Down
3 changes: 1 addition & 2 deletions src/routes/__snapshots__/Settings.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5488bb2

Please sign in to comment.