mirror of
https://github.com/foss42/apidash.git
synced 2025-06-05 19:14:25 +08:00
Update Send button and tests
This commit is contained in:
@ -18,17 +18,15 @@ class SendButton extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return ADFilledButton(
|
||||
onPressed: isWorking ? onCancel : onTap,
|
||||
isTonal: isWorking ? true : false,
|
||||
items: isWorking
|
||||
? const [
|
||||
kHSpacer8,
|
||||
Text(
|
||||
kLabelCancel,
|
||||
style: kTextStyleButton,
|
||||
),
|
||||
kHSpacer10,
|
||||
Icon(
|
||||
size: 16,
|
||||
Icons.cancel,
|
||||
)
|
||||
kHSpacer6,
|
||||
]
|
||||
: const [
|
||||
Text(
|
||||
|
@ -84,6 +84,8 @@ const kSizedBoxEmpty = SizedBox();
|
||||
const kHSpacer2 = SizedBox(width: 2);
|
||||
const kHSpacer4 = SizedBox(width: 4);
|
||||
const kHSpacer5 = SizedBox(width: 5);
|
||||
const kHSpacer6 = SizedBox(width: 6);
|
||||
const kHSpacer8 = SizedBox(width: 8);
|
||||
const kHSpacer10 = SizedBox(width: 10);
|
||||
const kHSpacer12 = SizedBox(width: 12);
|
||||
const kHSpacer20 = SizedBox(width: 20);
|
||||
|
@ -17,7 +17,7 @@ void main() {
|
||||
final icon = find.byIcon(Icons.snippet_folder_rounded);
|
||||
Finder button = find.ancestor(
|
||||
of: icon,
|
||||
matching: find.byWidgetPredicate((widget) => widget is ElevatedButton));
|
||||
matching: find.byWidgetPredicate((widget) => widget is FilledButton));
|
||||
|
||||
expect(button, findsOneWidget);
|
||||
expect(find.text(kLabelSelectFile), findsOneWidget);
|
||||
@ -37,7 +37,7 @@ void main() {
|
||||
final icon = find.byIcon(Icons.snippet_folder_rounded);
|
||||
Finder button = find.ancestor(
|
||||
of: icon,
|
||||
matching: find.byWidgetPredicate((widget) => widget is ElevatedButton));
|
||||
matching: find.byWidgetPredicate((widget) => widget is FilledButton));
|
||||
|
||||
expect(button, findsOneWidget);
|
||||
expect(find.text(testValue), findsOneWidget);
|
||||
@ -61,7 +61,7 @@ void main() {
|
||||
final icon = find.byIcon(Icons.snippet_folder_rounded);
|
||||
Finder button = find.ancestor(
|
||||
of: icon,
|
||||
matching: find.byWidgetPredicate((widget) => widget is ElevatedButton));
|
||||
matching: find.byWidgetPredicate((widget) => widget is FilledButton));
|
||||
|
||||
await tester.tap(button);
|
||||
await tester.pump();
|
||||
|
@ -56,7 +56,6 @@ void main() {
|
||||
// Verify initial cancel state
|
||||
expect(find.byIcon(Icons.send), findsNothing);
|
||||
expect(find.text(kLabelSend), findsNothing);
|
||||
expect(find.byIcon(Icons.cancel), findsOneWidget);
|
||||
expect(find.text(kLabelCancel), findsOneWidget);
|
||||
|
||||
// Tap and verify callback
|
||||
@ -94,7 +93,6 @@ void main() {
|
||||
await tester.pump();
|
||||
|
||||
// Verify cancel state
|
||||
expect(find.byIcon(Icons.cancel), findsOneWidget);
|
||||
expect(find.text(kLabelCancel), findsOneWidget);
|
||||
|
||||
// Tap to cancel
|
||||
|
Reference in New Issue
Block a user