-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from jja08111/amount_y_label
Update amount chart y labels
- Loading branch information
Showing
7 changed files
with
132 additions
and
15 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,73 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:time_chart/src/chart.dart'; | ||
import 'package:time_chart/time_chart.dart'; | ||
|
||
void main() { | ||
group('AmountChart y labels', () { | ||
testWidgets('have 4 hours intervals if max amount is over 8 hours', | ||
(tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: TimeChart( | ||
chartType: ChartType.amount, | ||
data: [ | ||
DateTimeRange( | ||
start: DateTime(2022, 5, 27, 0, 0), | ||
end: DateTime(2022, 5, 27, 8, 1), | ||
), | ||
], | ||
), | ||
)); | ||
|
||
await expectLater( | ||
find.byType(Chart), | ||
matchesGoldenFile('golden/y_label_golden1.png'), | ||
skip: !Platform.isMacOS, | ||
); | ||
}); | ||
|
||
testWidgets('have 2 hours intervals if max amount is in range (4, 8] hours', | ||
(tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: TimeChart( | ||
chartType: ChartType.amount, | ||
data: [ | ||
DateTimeRange( | ||
start: DateTime(2022, 5, 27, 0, 0), | ||
end: DateTime(2022, 5, 27, 5, 0), | ||
), | ||
], | ||
), | ||
)); | ||
|
||
await expectLater( | ||
find.byType(Chart), | ||
matchesGoldenFile('golden/y_label_golden2.png'), | ||
skip: !Platform.isMacOS, | ||
); | ||
}); | ||
|
||
testWidgets('have 1 hour interval if max amount is below 4 hours', | ||
(tester) async { | ||
await tester.pumpWidget(MaterialApp( | ||
home: TimeChart( | ||
chartType: ChartType.amount, | ||
data: [ | ||
DateTimeRange( | ||
start: DateTime(2022, 5, 27, 0, 0), | ||
end: DateTime(2022, 5, 27, 4, 0), | ||
), | ||
], | ||
), | ||
)); | ||
|
||
await expectLater( | ||
find.byType(Chart), | ||
matchesGoldenFile('golden/y_label_golden3.png'), | ||
skip: !Platform.isMacOS, | ||
); | ||
}); | ||
}); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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