mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 22:33:42 +00:00
test(ui): cover minimum extension card width
This commit is contained in:
1 parent
1262844363
commit
d578fe96bc
1 file changed
+2
-1
@@ -542,7 +542,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)],
|
||||||
@@ -560,6 +560,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