Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
081b598f
Unverified
Commit
081b598f
authored
Sep 16, 2020
by
Anthony
Committed by
GitHub
Sep 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Navigation Rail test with regression comment and cleaner size checking (#65877)
parent
13fcedc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
navigation_rail_test.dart
packages/flutter/test/material/navigation_rail_test.dart
+6
-4
No files found.
packages/flutter/test/material/navigation_rail_test.dart
View file @
081b598f
...
@@ -1794,6 +1794,7 @@ void main() {
...
@@ -1794,6 +1794,7 @@ void main() {
expect
(
rail
.
size
.
width
,
equals
(
300.0
));
expect
(
rail
.
size
.
width
,
equals
(
300.0
));
});
});
/// Regression test for https://github.com/flutter/flutter/issues/65657
testWidgets
(
'Extended rail transition does not jump from the beginning'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Extended rail transition does not jump from the beginning'
,
(
WidgetTester
tester
)
async
{
bool
extended
=
false
;
bool
extended
=
false
;
StateSetter
stateSetter
;
StateSetter
stateSetter
;
...
@@ -1833,9 +1834,10 @@ void main() {
...
@@ -1833,9 +1834,10 @@ void main() {
),
),
);
);
final
RenderBox
rail
=
tester
.
firstRenderObject
<
RenderBox
>(
find
.
byType
(
NavigationRail
)
);
final
Finder
rail
=
find
.
byType
(
NavigationRail
);
expect
(
rail
.
size
.
width
,
equals
(
72.0
));
// Before starting the animation, the rail has a width of 72.
expect
(
tester
.
getSize
(
rail
).
width
,
72.0
);
stateSetter
(()
{
stateSetter
(()
{
extended
=
true
;
extended
=
true
;
...
@@ -1845,10 +1847,10 @@ void main() {
...
@@ -1845,10 +1847,10 @@ void main() {
// Create very close to 0, but non-zero, animation value.
// Create very close to 0, but non-zero, animation value.
await
tester
.
pump
(
const
Duration
(
milliseconds:
1
));
await
tester
.
pump
(
const
Duration
(
milliseconds:
1
));
// Expect that it has started to extend.
// Expect that it has started to extend.
expect
(
rail
.
size
.
width
,
greaterThan
(
72.0
));
expect
(
tester
.
getSize
(
rail
)
.
width
,
greaterThan
(
72.0
));
// Expect that it has only extended by a small amount, or that the first
// Expect that it has only extended by a small amount, or that the first
// frame does not jump. This helps verify that it is a smooth animation.
// frame does not jump. This helps verify that it is a smooth animation.
expect
(
rail
.
size
.
width
,
closeTo
(
72.0
,
1.0
));
expect
(
tester
.
getSize
(
rail
)
.
width
,
closeTo
(
72.0
,
1.0
));
});
});
testWidgets
(
'Extended rail animation can be consumed'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Extended rail animation can be consumed'
,
(
WidgetTester
tester
)
async
{
...
...
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