Skip to content

Commit 5021853

Browse files
committed
fix: Fix lint issues in widget tests
- Add const to MaterialApp constructors - Remove const from localizationsDelegates array - All analyzer issues resolved
1 parent dc9dcd8 commit 5021853

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

mobile/test/widget_test.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,23 @@ void main() {
4141
ChangeNotifierProvider(create: (_) => SettingsProvider(prefs)),
4242
ChangeNotifierProvider(create: (_) => ServerStatusProvider()),
4343
],
44-
child: MaterialApp(
45-
localizationsDelegates: const [
44+
child: const MaterialApp(
45+
localizationsDelegates: [
4646
AppLocalizations.delegate,
4747
GlobalMaterialLocalizations.delegate,
4848
GlobalWidgetsLocalizations.delegate,
4949
GlobalCupertinoLocalizations.delegate,
5050
],
5151
supportedLocales: AppLocalizations.supportedLocales,
52-
home: const HomeScreen(),
52+
home: HomeScreen(),
5353
),
5454
),
5555
);
5656

5757
// Verify that the home screen displays
5858
expect(find.text('Paste Link to Clean'), findsOneWidget);
59-
expect(find.text('TraceOff — Clean Links'), findsOneWidget); // App bar title
59+
expect(
60+
find.text('TraceOff — Clean Links'), findsOneWidget); // App bar title
6061
});
6162

6263
testWidgets('URL input field accepts text', (WidgetTester tester) async {
@@ -71,15 +72,15 @@ void main() {
7172
ChangeNotifierProvider(create: (_) => SettingsProvider(prefs)),
7273
ChangeNotifierProvider(create: (_) => ServerStatusProvider()),
7374
],
74-
child: MaterialApp(
75-
localizationsDelegates: const [
75+
child: const MaterialApp(
76+
localizationsDelegates: [
7677
AppLocalizations.delegate,
7778
GlobalMaterialLocalizations.delegate,
7879
GlobalWidgetsLocalizations.delegate,
7980
GlobalCupertinoLocalizations.delegate,
8081
],
8182
supportedLocales: AppLocalizations.supportedLocales,
82-
home: const HomeScreen(),
83+
home: HomeScreen(),
8384
),
8485
),
8586
);
@@ -108,15 +109,15 @@ void main() {
108109
ChangeNotifierProvider(create: (_) => SettingsProvider(prefs)),
109110
ChangeNotifierProvider(create: (_) => ServerStatusProvider()),
110111
],
111-
child: MaterialApp(
112-
localizationsDelegates: const [
112+
child: const MaterialApp(
113+
localizationsDelegates: [
113114
AppLocalizations.delegate,
114115
GlobalMaterialLocalizations.delegate,
115116
GlobalWidgetsLocalizations.delegate,
116117
GlobalCupertinoLocalizations.delegate,
117118
],
118119
supportedLocales: AppLocalizations.supportedLocales,
119-
home: const HomeScreen(),
120+
home: HomeScreen(),
120121
),
121122
),
122123
);
@@ -139,7 +140,7 @@ void main() {
139140
// Verify the text was entered (the field should accept any text)
140141
// Note: The text might be formatted differently in the TextField
141142
expect(find.byType(TextField), findsOneWidget);
142-
143+
143144
// Verify that the TextField contains the URL we entered
144145
final textField = tester.widget<TextField>(find.byType(TextField));
145146
expect(textField.controller?.text, contains('https://gboard.app.goo.gl'));

0 commit comments

Comments
 (0)