Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
flutter_boost_1.22.4
Commits
d6056e50
Commit
d6056e50
authored
Mar 10, 2020
by
justin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test fix
parent
c1e77230
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
test/lib/unit/boost_container_test.dart
test/lib/unit/boost_container_test.dart
+7
-1
test/lib/unit/boost_page_route_test.dart
test/lib/unit/boost_page_route_test.dart
+9
-4
No files found.
test/lib/unit/boost_container_test.dart
View file @
d6056e50
...
...
@@ -137,7 +137,7 @@ void main() {
expect
(
find
.
text
(
'Y'
,
skipOffstage:
false
),
findsNothing
);
});
//
testWidgets
(
'Navigator.of
fails
gracefully when not found in context'
,
testWidgets
(
'Navigator.of gracefully when not found in context'
,
(
WidgetTester
tester
)
async
{
const
Key
targetKey
=
Key
(
'foo'
);
dynamic
exception
;
...
...
@@ -148,7 +148,13 @@ void main() {
},
);
await
tester
.
pumpWidget
(
widget
);
await
tester
.
pump
(
Duration
(
seconds:
1
));
await
tester
.
tap
(
find
.
byKey
(
targetKey
));
await
tester
.
pump
(
Duration
(
seconds:
1
));
expect
(
exception
,
isInstanceOf
<
FlutterError
>());
expect
(
'
$exception
'
,
startsWith
(
'Navigator operation requested with a context'
));
...
...
test/lib/unit/boost_page_route_test.dart
View file @
d6056e50
...
...
@@ -47,7 +47,7 @@ void main() {
group
(
'Try to get the BoostPageRoute in the ancestor node'
,
()
{
testWidgets
(
'obtain BoostPageRoute through the
`BoostPageRoute.of(context)`
method'
,
'obtain BoostPageRoute through the
BoostPageRoute.of(context)
method'
,
(
WidgetTester
tester
)
async
{
dynamic
boostPageRoute
;
dynamic
boostPageRouteFindByOfMethod
;
...
...
@@ -74,13 +74,15 @@ void main() {
await
tester
.
tap
(
find
.
byType
(
FloatingActionButton
));
await
tester
.
pump
(
Duration
(
seconds:
1
));
// The route obtained from the ancestor node through the `of` method should be the same BoostPageRoute
// as the originally created BoostPageRoute
expect
(
boostPageRoute
,
boostPageRouteFindByOfMethod
);
});
testWidgets
(
'try to find BoostPageRoute through the
`BoostPageRoute.of(context)`
method, '
'try to find BoostPageRoute through the
BoostPageRoute.of(context)
method, '
'but it doesn
\'
t exist, the method should throw an Exception'
,
(
WidgetTester
tester
)
async
{
dynamic
contextCache
;
...
...
@@ -102,12 +104,13 @@ void main() {
),
);
await
tester
.
tap
(
find
.
byType
(
FloatingActionButton
));
await
tester
.
pump
(
Duration
(
seconds:
1
));
expect
(()
=>
BoostPageRoute
.
of
<
dynamic
>(
contextCache
),
throwsException
);
});
testWidgets
(
'obtain BoostPageRoute through the
`BoostPageRoute.tryOf(context)`
method'
,
'obtain BoostPageRoute through the
BoostPageRoute.tryOf(context)
method'
,
(
WidgetTester
tester
)
async
{
dynamic
boostPageRoute
;
dynamic
boostPageRouteFindByOfMethod
;
...
...
@@ -134,6 +137,7 @@ void main() {
);
await
tester
.
tap
(
find
.
byType
(
FloatingActionButton
));
await
tester
.
pump
(
Duration
(
seconds:
1
));
// The route obtained from the ancestor node through the `tryOf` method should be the same BoostPageRoute
// as the originally created BoostPageRoute
...
...
@@ -142,7 +146,7 @@ void main() {
});
testWidgets
(
'try to find BoostPageRoute through the
`BoostPageRoute.tryOf(context)`
method, '
'try to find BoostPageRoute through the
BoostPageRoute.tryOf(context)
method, '
'but it doesn
\'
t exist, the method should return null'
,
(
WidgetTester
tester
)
async
{
dynamic
boostPageRouteFindByOfMethod
;
...
...
@@ -168,6 +172,7 @@ void main() {
);
await
tester
.
tap
(
find
.
byType
(
FloatingActionButton
));
await
tester
.
pump
(
Duration
(
seconds:
1
));
expect
(
boostPageRouteFindByOfMethod
,
null
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment