widget_extensions_test.dart
2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:get/utils.dart';
void main() {
group('Group test for PaddingX Extension', () {
testWidgets('Test of paddingAll', (tester) async {
Widget containerTest;
expect(find.byType(Padding), findsNothing);
await tester.pumpWidget(containerTest.paddingAll(16));
expect(find.byType(Padding), findsOneWidget);
});
testWidgets('Test of paddingOnly', (tester) async {
Widget containerTest;
expect(find.byType(Padding), findsNothing);
await tester.pumpWidget(containerTest.paddingOnly(top: 16));
expect(find.byType(Padding), findsOneWidget);
});
testWidgets('Test of paddingSymmetric', (tester) async {
Widget containerTest;
expect(find.byType(Padding), findsNothing);
await tester.pumpWidget(containerTest.paddingSymmetric(vertical: 16));
expect(find.byType(Padding), findsOneWidget);
});
testWidgets('Test of paddingZero', (tester) async {
Widget containerTest;
expect(find.byType(Padding), findsNothing);
await tester.pumpWidget(containerTest.paddingZero);
expect(find.byType(Padding), findsOneWidget);
});
});
group('Group test for MarginX Extension', () {
testWidgets('Test of marginAll', (tester) async {
Widget containerTest;
await tester.pumpWidget(containerTest.marginAll(16));
expect(find.byType(Container), findsOneWidget);
});
testWidgets('Test of marginOnly', (tester) async {
Widget containerTest;
await tester.pumpWidget(containerTest.marginOnly(top: 16));
expect(find.byType(Container), findsOneWidget);
});
testWidgets('Test of marginSymmetric', (tester) async {
Widget containerTest;
await tester.pumpWidget(containerTest.marginSymmetric(vertical: 16));
expect(find.byType(Container), findsOneWidget);
});
testWidgets('Test of marginZero', (tester) async {
Widget containerTest;
await tester.pumpWidget(containerTest.marginZero);
expect(find.byType(Container), findsOneWidget);
});
});
}