Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ryan
2020-05-21 22:09:23 -0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c65ea0bec7007de90e6172fd4ad18cd8db8c8f2e
c65ea0be
1 parent
c7ad9c94
feat: add test for dialog
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
test/dialog_test.dart
test/dialog_test.dart
0 → 100644
View file @
c65ea0b
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:get/get.dart'
;
import
'util/wrapper.dart'
;
void
main
(
)
{
testWidgets
(
"Get.defaultDialog smoke test"
,
(
tester
)
async
{
await
tester
.
pumpWidget
(
Wrapper
(
child:
Container
()),
);
Get
.
defaultDialog
(
onConfirm:
()
=>
print
(
"Ok"
),
middleText:
"Dialog made in 3 lines of code"
);
await
tester
.
pumpAndSettle
();
expect
(
find
.
text
(
"Ok"
),
findsOneWidget
);
});
testWidgets
(
"Get.dialog smoke test"
,
(
tester
)
async
{
await
tester
.
pumpWidget
(
Wrapper
(
child:
Container
()),
);
Get
.
dialog
(
YourDialogWidget
());
await
tester
.
pumpAndSettle
();
expect
(
find
.
byType
(
YourDialogWidget
),
findsOneWidget
);
});
}
class
YourDialogWidget
extends
StatelessWidget
{
const
YourDialogWidget
({
Key
key
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
Container
();
}
}
...
...
Please
register
or
login
to post a comment