Skip to content

Commit 0e44531

Browse files
authored
Merge pull request #97 from Akshatji800/settings_page_widget_tests
Adds settings page widget tests.
2 parents 3b9a5fd + eab9b3e commit 0e44531

File tree

2 files changed

+345
-0
lines changed

2 files changed

+345
-0
lines changed

lib/Pages/settings_screen.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ class SpeedLimitSection extends StatelessWidget {
352352
@override
353353
Widget build(BuildContext context) {
354354
return ExpansionTileCard(
355+
key: Key('Speed Limit Expansion Card'),
355356
onExpansionChanged: (value) {},
356357
elevation: 0,
357358
expandedColor: ThemeProvider.theme.primaryColor,
@@ -361,6 +362,7 @@ class SpeedLimitSection extends StatelessWidget {
361362
contentPadding: EdgeInsets.all(0),
362363
children: [
363364
Column(
365+
key: Key('Speed Limit options column'),
364366
crossAxisAlignment: CrossAxisAlignment.start,
365367
mainAxisAlignment: MainAxisAlignment.start,
366368
children: [
@@ -383,6 +385,7 @@ class SpeedLimitSection extends StatelessWidget {
383385
),
384386
child: Center(
385387
child: DropdownButtonFormField<String>(
388+
key: Key('Download Speed Dropdown'),
386389
dropdownColor: ThemeProvider.theme.primaryColorLight,
387390
isExpanded: true,
388391
decoration: InputDecoration(
@@ -427,6 +430,7 @@ class SpeedLimitSection extends StatelessWidget {
427430
),
428431
child: Center(
429432
child: DropdownButtonFormField<String>(
433+
key: Key('Upload Speed Dropdown'),
430434
dropdownColor: ThemeProvider.theme.backgroundColor,
431435
isExpanded: true,
432436
decoration: InputDecoration(
@@ -540,6 +544,7 @@ class AuthenticationSection extends StatelessWidget {
540544
@override
541545
Widget build(BuildContext context) {
542546
return ExpansionTileCard(
547+
key: Key('Authentication Expansion Card'),
543548
onExpansionChanged: (value) {},
544549
elevation: 0,
545550
expandedColor: ThemeProvider.theme.primaryColor,
@@ -549,6 +554,7 @@ class AuthenticationSection extends StatelessWidget {
549554
contentPadding: EdgeInsets.all(0),
550555
children: [
551556
Column(
557+
key: Key('Authentication option display column'),
552558
crossAxisAlignment: CrossAxisAlignment.start,
553559
children: [
554560
SText(text: 'Add User'),
@@ -602,6 +608,7 @@ class AuthenticationSection extends StatelessWidget {
602608
child: ButtonTheme(
603609
alignedDropdown: true,
604610
child: DropdownButton<String>(
611+
key: Key('Authentication dropdown'),
605612
isExpanded: true,
606613
value: client,
607614
icon: const Icon(Icons.keyboard_arrow_down_rounded),
@@ -798,6 +805,7 @@ class ResourceSection extends StatelessWidget {
798805
@override
799806
Widget build(BuildContext context) {
800807
return ExpansionTileCard(
808+
key: Key('Resources Expansion Card'),
801809
onExpansionChanged: (value) {},
802810
elevation: 0,
803811
expandedColor: ThemeProvider.theme.primaryColor,
@@ -807,6 +815,7 @@ class ResourceSection extends StatelessWidget {
807815
contentPadding: EdgeInsets.all(0),
808816
children: [
809817
Column(
818+
key: Key('Resources options display column'),
810819
crossAxisAlignment: CrossAxisAlignment.start,
811820
children: [
812821
SText(text: 'Disk'),
@@ -840,6 +849,7 @@ class ResourceSection extends StatelessWidget {
840849
height: 5,
841850
),
842851
CheckboxListTile(
852+
key: Key('Verify Hash checkbox'),
843853
activeColor: ThemeProvider.theme.backgroundColor,
844854
tileColor: ThemeProvider.theme.primaryColorLight,
845855
shape: RoundedRectangleBorder(
@@ -917,6 +927,7 @@ class ConnectivitySection extends StatelessWidget {
917927
@override
918928
Widget build(BuildContext context) {
919929
return ExpansionTileCard(
930+
key: Key('Connectivity Expansion Card'),
920931
elevation: 0,
921932
expandedColor: ThemeProvider.theme.primaryColor,
922933
baseColor: ThemeProvider.theme.primaryColor,
@@ -925,6 +936,7 @@ class ConnectivitySection extends StatelessWidget {
925936
contentPadding: EdgeInsets.all(0),
926937
children: [
927938
Column(
939+
key: Key('Connectivity option display column'),
928940
crossAxisAlignment: CrossAxisAlignment.start,
929941
children: [
930942
SText(text: 'Incoming Connections'),
@@ -941,6 +953,7 @@ class ConnectivitySection extends StatelessWidget {
941953
children: [
942954
Expanded(
943955
child: CheckboxListTile(
956+
key: Key('Checkbox Randomize Port'),
944957
activeColor: ThemeProvider.theme.primaryColorDark,
945958
tileColor: ThemeProvider.theme.primaryColorLight,
946959
shape: RoundedRectangleBorder(
@@ -959,6 +972,7 @@ class ConnectivitySection extends StatelessWidget {
959972
),
960973
Expanded(
961974
child: CheckboxListTile(
975+
key: Key('Checkbox Open Port'),
962976
activeColor: ThemeProvider.theme.primaryColorDark,
963977
tileColor: ThemeProvider.theme.primaryColorLight,
964978
shape: RoundedRectangleBorder(
@@ -997,6 +1011,7 @@ class ConnectivitySection extends StatelessWidget {
9971011
children: [
9981012
Expanded(
9991013
child: CheckboxListTile(
1014+
key: Key('Checkbox Enable DHT'),
10001015
activeColor: ThemeProvider.theme.primaryColorDark,
10011016
tileColor: ThemeProvider.theme.primaryColorLight,
10021017
shape: RoundedRectangleBorder(
@@ -1019,6 +1034,7 @@ class ConnectivitySection extends StatelessWidget {
10191034
),
10201035
Expanded(
10211036
child: CheckboxListTile(
1037+
key: Key('Checkbox Enable Peer Exchange'),
10221038
activeColor: ThemeProvider.theme.primaryColorDark,
10231039
tileColor: ThemeProvider.theme.primaryColorLight,
10241040
shape: RoundedRectangleBorder(
@@ -1108,6 +1124,7 @@ class BandwidthSection extends StatelessWidget {
11081124
@override
11091125
Widget build(BuildContext context) {
11101126
return ExpansionTileCard(
1127+
key: Key('Bandwidth Expansion Card'),
11111128
initiallyExpanded: true,
11121129
onExpansionChanged: (value) {},
11131130
elevation: 0,
@@ -1118,6 +1135,7 @@ class BandwidthSection extends StatelessWidget {
11181135
contentPadding: EdgeInsets.all(0),
11191136
children: [
11201137
Column(
1138+
key: Key('Bandwidth option display column'),
11211139
crossAxisAlignment: CrossAxisAlignment.start,
11221140
children: [
11231141
SText(text: 'Transfer Rate Throttles'),

0 commit comments

Comments
 (0)