mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 06:43:42 +00:00
Merge latest PR #1511 into 2.0.0-beta.2
This commit is contained in:
commit
f839c3ac93
2 files changed
+8
-2
No files matched your search
@@ -28,7 +28,7 @@ import '../widgets/extension_icon.dart';
|
|||||||
import '../widgets/extension_setting_field.dart';
|
import '../widgets/extension_setting_field.dart';
|
||||||
import '../widgets/extension_update_dialog.dart';
|
import '../widgets/extension_update_dialog.dart';
|
||||||
|
|
||||||
const _extensionCardMinWidth = 296.0;
|
const _extensionCardMinWidth = 290.0;
|
||||||
const _extensionGridSpacing = 10.0;
|
const _extensionGridSpacing = 10.0;
|
||||||
|
|
||||||
int _extensionGridColumnCount(double width) {
|
int _extensionGridColumnCount(double width) {
|
||||||
|
|||||||
@@ -592,6 +592,11 @@ void main() {
|
|||||||
closeTo(tester.getRect(find.byKey(const ValueKey('extension-card-extension-2'))).right, 0.01),
|
closeTo(tester.getRect(find.byKey(const ValueKey('extension-card-extension-2'))).right, 0.01),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tester.view.physicalSize = const Size(1024, 768);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(gridColumns(), 3);
|
||||||
|
expect(tester.getSize(find.byKey(const ValueKey('extension-card-extension-0'))).width, greaterThanOrEqualTo(290));
|
||||||
|
|
||||||
tester.view.physicalSize = const Size(1028, 608);
|
tester.view.physicalSize = const Size(1028, 608);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(gridColumns(), 3);
|
expect(gridColumns(), 3);
|
||||||
@@ -625,7 +630,7 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('extension cards compact large counts without crowding their actions', (WidgetTester tester) async {
|
testWidgets('extension cards compact large counts without crowding their actions', (WidgetTester tester) async {
|
||||||
await _setTestSize(tester, const Size(750, 608));
|
await _setTestSize(tester, const Size(722, 608));
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
ProviderScope(
|
ProviderScope(
|
||||||
overrides: [extensionsControllerProvider.overrideWith(CrowdedExtensionCardController.new)],
|
overrides: [extensionsControllerProvider.overrideWith(CrowdedExtensionCardController.new)],
|
||||||
@@ -643,6 +648,7 @@ void main() {
|
|||||||
final cardRect = tester.getRect(find.byKey(const ValueKey('extension-card-crowded-extension')));
|
final cardRect = tester.getRect(find.byKey(const ValueKey('extension-card-crowded-extension')));
|
||||||
final statsRect = tester.getRect(find.byKey(const ValueKey('extension-card-stats-crowded-extension')));
|
final statsRect = tester.getRect(find.byKey(const ValueKey('extension-card-stats-crowded-extension')));
|
||||||
final actionsRect = tester.getRect(find.byKey(const ValueKey('extension-card-actions-crowded-extension')));
|
final actionsRect = tester.getRect(find.byKey(const ValueKey('extension-card-actions-crowded-extension')));
|
||||||
|
expect(cardRect.width, closeTo(290, 0.01));
|
||||||
expect(statsRect.right, lessThanOrEqualTo(actionsRect.left - 8));
|
expect(statsRect.right, lessThanOrEqualTo(actionsRect.left - 8));
|
||||||
expect(actionsRect.right, lessThanOrEqualTo(cardRect.right - 14));
|
expect(actionsRect.right, lessThanOrEqualTo(cardRect.right - 14));
|
||||||
expect(tester.takeException(), isNull);
|
expect(tester.takeException(), isNull);
|
||||||
|
|||||||
Reference in new issue
Block a user