-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91db62f
commit 08b5473
Showing
5 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:frontend/components/auth/auth_logo_tile.dart'; | ||
|
||
void main() { | ||
TestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
group('LogoTile Tests', () { | ||
testWidgets('Displays an image from the provided imagePath', | ||
(WidgetTester tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: Scaffold( | ||
body: AuthLogoTile( | ||
imagePath: 'test/assets/images/google-logo.png', | ||
onTap: () {}, | ||
), | ||
), | ||
)); | ||
|
||
expect(find.byType(Image), findsOneWidget); | ||
}); | ||
|
||
testWidgets('Responds to tap events', (WidgetTester tester) async { | ||
bool tapped = false; | ||
|
||
await tester.pumpWidget(MaterialApp( | ||
home: Scaffold( | ||
body: AuthLogoTile( | ||
imagePath: 'test/assets/images/google-logo.png', | ||
onTap: () { | ||
tapped = true; | ||
}, | ||
), | ||
), | ||
)); | ||
|
||
await tester.tap(find.byType(AuthLogoTile)); | ||
await tester.pump(); | ||
|
||
expect(tapped, true); | ||
}); | ||
}); | ||
} |
File renamed without changes.