diff --git a/test/moderation_settings/screens/community_type_screen_test.dart b/test/moderation_settings/screens/community_type_screen_test.dart index dc39bc35..4a3eb6c6 100644 --- a/test/moderation_settings/screens/community_type_screen_test.dart +++ b/test/moderation_settings/screens/community_type_screen_test.dart @@ -3,49 +3,77 @@ import 'package:post/moderation_settings/screens/community_type_screen.dart'; void main() { group('test the is Selected cahgned or not', () { - test(' ', () { + test(' index and is plus 18 both changed ', () { final EditMuted = ComuunityTypesScreenState(); EditMuted.initialIndex = 12; EditMuted.initialIsPlus18 = true; EditMuted.index = 6; - EditMuted.initialIsPlus18 = false; + EditMuted.isPlus18 = false; // login.inputUserNameController.text = 'asdwa'; EditMuted.changeCommunityType(); expect(EditMuted.isSlected, true); }); - test('user name is not empty ', () { + test('is plus 18 only changed ', () { final EditMuted = ComuunityTypesScreenState(); EditMuted.initialIndex = 12; EditMuted.initialIsPlus18 = true; EditMuted.index = 12; - EditMuted.initialIsPlus18 = false; + EditMuted.isPlus18 = false; // login.inputUserNameController.text = 'asdwa'; EditMuted.changeCommunityType(); expect(EditMuted.isSlected, true); }); - test('user name is not empty ', () { + test('index only changed ', () { final EditMuted = ComuunityTypesScreenState(); EditMuted.initialIndex = 12; EditMuted.initialIsPlus18 = true; EditMuted.index = 6; - EditMuted.initialIsPlus18 = true; + EditMuted.isPlus18 = true; // login.inputUserNameController.text = 'asdwa'; EditMuted.changeCommunityType(); expect(EditMuted.isSlected, true); }); - test('user name is not empty ', () { + test('both the same ', () { final EditMuted = ComuunityTypesScreenState(); EditMuted.initialIndex = 12; EditMuted.initialIsPlus18 = true; EditMuted.index = 12; - EditMuted.initialIsPlus18 = true; + EditMuted.isPlus18 = true; // login.inputUserNameController.text = 'asdwa'; EditMuted.changeCommunityType(); expect(EditMuted.isSlected, false); }); }); + group('test changeType', () { + test(' ', () { + final EditMuted = ComuunityTypesScreenState(); + EditMuted.index = 12.0; + EditMuted.changeType(20.0); + // login.inputUserNameController.text = 'asdwa'; + EditMuted.changeCommunityType(); + expect(EditMuted.index.toDouble(), 20.0); + }); + }); + group('changePlus18', () { + test(' ', () { + final EditMuted = ComuunityTypesScreenState(); + EditMuted.isPlus18 = true; + EditMuted.changePlus18(); + // login.inputUserNameController.text = 'asdwa'; + EditMuted.changeCommunityType(); + expect(EditMuted.isPlus18, false); + }); + test(' ', () { + final EditMuted = ComuunityTypesScreenState(); + EditMuted.isPlus18 = false; + EditMuted.changePlus18(); + // login.inputUserNameController.text = 'asdwa'; + EditMuted.changeCommunityType(); + expect(EditMuted.isPlus18, true); + }); + }); } diff --git a/test/moderation_settings/screens/description_screen_test.dart b/test/moderation_settings/screens/description_screen_test.dart new file mode 100644 index 00000000..71aef53a --- /dev/null +++ b/test/moderation_settings/screens/description_screen_test.dart @@ -0,0 +1,19 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:post/moderation_settings/screens/description_screen.dart'; + +void main() { + group('check change focus', () { + test(' test change description when the new value is the initial ', () { + final EditMuted = DescriptionState(); + EditMuted.initialDescription = 'hamada'; + EditMuted.changeDescription('hamada'); + expect(EditMuted.isSlected, false); + }); + test(' test change description when the new value is not the initial ', () { + final EditMuted = DescriptionState(); + EditMuted.initialDescription = 'hamada'; + EditMuted.changeDescription('yaser'); + expect(EditMuted.isSlected, true); + }); + }); +} diff --git a/test/moderation_settings/screens/location_screen_test.dart b/test/moderation_settings/screens/location_screen_test.dart new file mode 100644 index 00000000..c02b08dd --- /dev/null +++ b/test/moderation_settings/screens/location_screen_test.dart @@ -0,0 +1,19 @@ +import 'package:flutter_test/flutter_test.dart'; +import '../../../lib/moderation_settings/screens/location_screen.dart'; + +void main() { + group('check change focus', () { + test(' test change description when the new value is the initial ', () { + final EditMuted = LocationScreenState(); + EditMuted.initialDescription = 'hamada'; + EditMuted.changeDescription('hamada'); + expect(EditMuted.isSlected, false); + }); + test(' test change description when the new value is not the initial ', () { + final EditMuted = LocationScreenState(); + EditMuted.initialDescription = 'hamada'; + EditMuted.changeDescription('yaser'); + expect(EditMuted.isSlected, true); + }); + }); +}