Repository: flutter/flutter
File: packages/flutter/test/cupertino/button_test.dart (Dart)

Code before:
      SystemMouseCursors.forbidden,
    );

    // Test focused state mouse cursor
    await tester.pumpWidget(buildButton(enabled: true, cursor: const _ButtonMouseCursor()));
    focusNode.requestFocus();
    await tester.pump();
    expect(
      RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
      SystemMouseCursors.copy,
    );
    focusNode.unfocus();

    // Test pressed state mouse cursor
    await tester.createGesture(kind: PointerDeviceKind.mouse);
    await gesture.down(tester.getCenter(find.byType(CupertinoButton)));
    await tester.pump();
    expect(
      RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
      SystemMouseCursors.grab,
    );
    await gesture.up();
    await gesture.removePointer();
  });

  testWidgets('CupertinoButton respects foregroundColor', (WidgetTester tester) async {
    const Color customForegroundColor = Color(0xFF5500FF);

    await tester.pumpWidget(
      boilerplate(
        child: CupertinoButton(
          onPressed: () {},
          foregroundColor: customForegroundColor,
          child: const Text('Button'),
        ),
      ),
    );

    // Check that the text has the custom foreground color
    final RichText text = tester.widget(
      find.descendant(of: find.byType(CupertinoButton), matching: find.byType(RichText)),
    );
    expect(text.text.style?.color, customForegroundColor);
  });

  testWidgets('CupertinoButton foregroundColor applies to Icon', (WidgetTester tester) async {
    const Color customForegroundColor = Color(0xFF5500FF);

    await tester.pumpWidget(
      boilerplate(
        child: CupertinoButton(

Review comment (suggestion):
```suggestion
  testWidgets('CupertinoButton foregroundColor applies to its text', (WidgetTester tester) async {
```

Code after:
    await gesture.moveTo(tester.getCenter(find.byType(CupertinoButton)));
    expect(
      RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
      SystemMouseCursors.basic,
    );

    // Test disabled state mouse cursor
    await tester.pumpWidget(buildButton(enabled: false, cursor: const _ButtonMouseCursor()));
    await gesture.moveTo(tester.getCenter(find.byType(CupertinoButton)));
    expect(
      RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
      SystemMouseCursors.forbidden,
    );

    // Test focused state mouse cursor
    await tester.pumpWidget(buildButton(enabled: true, cursor: const _ButtonMouseCursor()));
    focusNode.requestFocus();
    await tester.pump();
    expect(
      RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
      SystemMouseCursors.copy,
    );
    focusNode.unfocus();

    // Test pressed state mouse cursor
    await tester.createGesture(kind: PointerDeviceKind.mouse);
    await gesture.down(tester.getCenter(find.byType(CupertinoButton)));
    await tester.pump();
    expect(
      RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
      SystemMouseCursors.grab,
    );
    await gesture.up();
    await gesture.removePointer();
  });

  testWidgets('CupertinoButton foregroundColor applies to its text', (WidgetTester tester) async {
    const Color customForegroundColor = Color(0xFF5500FF);

    await tester.pumpWidget(
      boilerplate(
        child: CupertinoButton(
          onPressed: () {},
          foregroundColor: customForegroundColor,
          child: const Text('Button'),
        ),
      ),
    );

    // Check that the text has the custom foreground color
    final RichText text = tester.widget(