-
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
5f013b8
commit 9babc5a
Showing
4 changed files
with
69 additions
and
61 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
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,36 @@ | ||
// This is a basic Flutter widget test. | ||
// | ||
// To perform an interaction with a widget in your test, use the WidgetTester | ||
// utility in the flutter_test package. For example, you can send tap and scroll | ||
// gestures. You can also use WidgetTester to find child widgets in the widget | ||
// tree, read text, and verify that the values of widget properties are correct. | ||
|
||
@TestOn('browser') | ||
library; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import 'package:portfolio/main.dart'; | ||
import 'package:portfolio/navigation/router.dart'; | ||
import 'package:portfolio/widgets/language_toggle_button.dart'; | ||
|
||
void main() { | ||
testWidgets('App bar does not overflow in neither language', (tester) async { | ||
tester.view.devicePixelRatio = 1.0; | ||
tester.view.physicalSize = const Size(840, 600); | ||
|
||
// Change if nothing overflows in the default language | ||
await tester.pumpWidget( | ||
ProviderScope(child: MyApp(router: AppRouter())), | ||
); | ||
await tester.pumpAndSettle(); | ||
|
||
// Change language and check if nothing overflows | ||
final languageButton = find.byType(LanguageToggleButton); | ||
expect(languageButton, findsOne); | ||
await tester.tap(languageButton); | ||
await tester.pumpAndSettle(); | ||
}); | ||
} |
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