@umituz/react-native-settings 4.23.97 β 4.23.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/domains/about/domain/entities/AppInfo.ts +1 -0
- package/src/domains/about/presentation/components/AboutContent.tsx +6 -6
- package/src/domains/about/presentation/screens/AboutScreen.tsx +2 -4
- package/src/domains/appearance/presentation/screens/AppearanceScreen.tsx +9 -12
- package/src/domains/disclaimer/presentation/components/DisclaimerSetting.tsx +9 -20
- package/src/domains/disclaimer/presentation/screens/DisclaimerScreen.tsx +2 -6
- package/src/domains/gamification/types/index.ts +12 -12
- package/src/domains/localization/presentation/components/LanguageSection.tsx +3 -3
- package/src/domains/localization/presentation/screens/LanguageSelectionScreen.tsx +1 -1
- package/src/domains/notifications/presentation/components/NotificationsSection.tsx +2 -4
- package/src/domains/notifications/presentation/screens/NotificationSettingsScreen.tsx +1 -3
- package/src/infrastructure/utils/configFactory.ts +3 -14
- package/src/presentation/hooks/useSettingsScreenConfig.ts +27 -12
- package/src/presentation/navigation/SettingsStackNavigator.tsx +9 -8
- package/src/presentation/navigation/hooks/useNavigationHandlers.ts +4 -2
- package/src/presentation/navigation/hooks/useSettingsScreens.ts +10 -10
- package/src/presentation/navigation/utils/navigationTranslations.ts +29 -32
- package/src/presentation/screens/SettingsScreen.tsx +5 -1
- package/src/presentation/screens/components/GamificationSettingsItem.tsx +3 -6
- package/src/presentation/screens/components/SettingsContent.tsx +9 -5
- package/src/presentation/screens/components/SettingsHeader.tsx +4 -3
- package/src/presentation/screens/components/SubscriptionSettingsItem.tsx +3 -4
- package/src/presentation/screens/components/VideoTutorialSettingsItem.tsx +2 -4
- package/src/presentation/screens/components/WalletSettingsItem.tsx +3 -4
- package/src/presentation/screens/components/sections/FeatureSettingsSection.tsx +11 -13
- package/src/presentation/screens/components/sections/IdentitySettingsSection.tsx +5 -6
- package/src/presentation/screens/components/sections/ProfileSectionLoader.tsx +11 -9
- package/src/presentation/screens/components/sections/SupportSettingsSection.tsx +22 -23
- package/src/presentation/screens/types/SettingsConfig.ts +97 -6
- package/src/presentation/utils/accountConfigUtils.ts +9 -17
- package/src/presentation/utils/config-creators/base-configs.ts +0 -22
- package/src/presentation/utils/config-creators/feature-configs.ts +0 -20
- package/src/presentation/utils/config-creators/support-configs.ts +2 -12
- package/src/presentation/utils/faqTranslator.ts +5 -18
- package/src/presentation/utils/settingsConfigFactory.ts +10 -13
- package/src/presentation/utils/useAuthHandlers.ts +13 -20
- package/src/presentation/utils/userProfileUtils.ts +2 -16
- package/src/domains/disclaimer/README.md +0 -87
- package/src/domains/disclaimer/presentation/components/DisclaimerCard.test.tsx +0 -208
- package/src/domains/disclaimer/presentation/components/DisclaimerModal.test.tsx +0 -236
- package/src/domains/disclaimer/presentation/components/DisclaimerSetting.test.tsx +0 -74
- package/src/domains/disclaimer/presentation/components/README.md +0 -97
- package/src/domains/localization/presentation/components/__tests__/LanguageItem.test.tsx +0 -106
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Language Item Component Tests
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { render, fireEvent } from '@testing-library/react-native';
|
|
7
|
-
import { LanguageItem } from '../LanguageItem';
|
|
8
|
-
import type { Language } from '../../infrastructure/storage/types/LocalizationState';
|
|
9
|
-
|
|
10
|
-
const mockLanguage: Language = {
|
|
11
|
-
code: 'en-US',
|
|
12
|
-
name: 'English',
|
|
13
|
-
nativeName: 'English',
|
|
14
|
-
flag: 'πΊπΈ',
|
|
15
|
-
isRTL: false,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
describe('LanguageItem', () => {
|
|
19
|
-
const mockOnSelect = jest.fn();
|
|
20
|
-
|
|
21
|
-
beforeEach(() => {
|
|
22
|
-
mockOnSelect.mockClear();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should render language information correctly', () => {
|
|
26
|
-
const { getAllByText } = render(
|
|
27
|
-
<LanguageItem
|
|
28
|
-
item={mockLanguage}
|
|
29
|
-
isSelected={false}
|
|
30
|
-
onSelect={mockOnSelect}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
expect(getAllByText('English')).toHaveLength(2); // nativeName and name
|
|
35
|
-
expect(getAllByText('πΊπΈ')).toHaveLength(1);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('should show check icon when selected', () => {
|
|
39
|
-
const { getByText } = render(
|
|
40
|
-
<LanguageItem
|
|
41
|
-
item={mockLanguage}
|
|
42
|
-
isSelected={true}
|
|
43
|
-
onSelect={mockOnSelect}
|
|
44
|
-
/>
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
expect(getByText('β')).toBeTruthy();
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('should not show check icon when not selected', () => {
|
|
51
|
-
const { queryByText } = render(
|
|
52
|
-
<LanguageItem
|
|
53
|
-
item={mockLanguage}
|
|
54
|
-
isSelected={false}
|
|
55
|
-
onSelect={mockOnSelect}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
expect(queryByText('β')).toBeFalsy();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('should call onSelect when pressed', () => {
|
|
63
|
-
const { getByTestId } = render(
|
|
64
|
-
<LanguageItem
|
|
65
|
-
item={mockLanguage}
|
|
66
|
-
isSelected={false}
|
|
67
|
-
onSelect={mockOnSelect}
|
|
68
|
-
testID="language-item-test"
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
fireEvent.press(getByTestId('language-item-test'));
|
|
73
|
-
expect(mockOnSelect).toHaveBeenCalledWith('en-US');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('should use default flag when none provided', () => {
|
|
77
|
-
const languageWithoutFlag = { ...mockLanguage, flag: undefined };
|
|
78
|
-
const { getByText } = render(
|
|
79
|
-
<LanguageItem
|
|
80
|
-
item={languageWithoutFlag}
|
|
81
|
-
isSelected={false}
|
|
82
|
-
onSelect={mockOnSelect}
|
|
83
|
-
/>
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
expect(getByText('π')).toBeTruthy();
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('should apply custom styles', () => {
|
|
90
|
-
const customStyles = {
|
|
91
|
-
languageItem: { backgroundColor: 'red' },
|
|
92
|
-
flag: { fontSize: 30 },
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const { getByTestId } = render(
|
|
96
|
-
<LanguageItem
|
|
97
|
-
item={mockLanguage}
|
|
98
|
-
isSelected={false}
|
|
99
|
-
onSelect={mockOnSelect}
|
|
100
|
-
customStyles={customStyles}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
expect(getByTestId('language-item-test')).toBeTruthy();
|
|
105
|
-
});
|
|
106
|
-
});
|