Single Flutter package at the repo root. All code, tests, assets, and platform directories moved from app/ to root. Package renamed from clide_app to clide — all imports rewritten. Merged pubspec combines core (ffi) and app (flutter, yaml, xterm) dependencies. Makefile simplified: no APP_PRESENT conditionals, no cd, no daemon lifecycle. 317 tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
86 lines
2.2 KiB
Dart
86 lines
2.2 KiB
Dart
import 'package:alchemist/alchemist.dart';
|
|
import 'package:clide/widgets/widgets.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import '../helpers/kernel_fixture.dart';
|
|
import '../helpers/widget_harness.dart';
|
|
|
|
void main() {
|
|
late KernelFixture f;
|
|
|
|
setUp(() async => f = await KernelFixture.create());
|
|
tearDown(() async => f.dispose());
|
|
|
|
goldenTest(
|
|
'ClideButton variants + states',
|
|
fileName: 'clide_button',
|
|
pumpBeforeTest: (tester) async {
|
|
// wait for hover/press state to settle
|
|
await tester.pump(const Duration(milliseconds: 50));
|
|
},
|
|
builder: () => GoldenTestGroup(
|
|
columns: 3,
|
|
children: [
|
|
GoldenTestScenario(
|
|
name: 'normal / enabled',
|
|
child: _wrap(f, ClideButton(label: 'Save', onPressed: () {})),
|
|
),
|
|
GoldenTestScenario(
|
|
name: 'normal / disabled',
|
|
child: _wrap(f, const ClideButton(label: 'Save', onPressed: null)),
|
|
),
|
|
GoldenTestScenario(
|
|
name: 'primary / enabled',
|
|
child: _wrap(
|
|
f,
|
|
ClideButton(
|
|
label: 'Commit',
|
|
onPressed: () {},
|
|
variant: ClideButtonVariant.primary,
|
|
),
|
|
),
|
|
),
|
|
GoldenTestScenario(
|
|
name: 'primary / disabled',
|
|
child: _wrap(
|
|
f,
|
|
const ClideButton(
|
|
label: 'Commit',
|
|
onPressed: null,
|
|
variant: ClideButtonVariant.primary,
|
|
),
|
|
),
|
|
),
|
|
GoldenTestScenario(
|
|
name: 'subtle / enabled',
|
|
child: _wrap(
|
|
f,
|
|
ClideButton(
|
|
label: 'Open',
|
|
onPressed: () {},
|
|
variant: ClideButtonVariant.subtle,
|
|
),
|
|
),
|
|
),
|
|
GoldenTestScenario(
|
|
name: 'subtle / disabled',
|
|
child: _wrap(
|
|
f,
|
|
const ClideButton(
|
|
label: 'Open',
|
|
onPressed: null,
|
|
variant: ClideButtonVariant.subtle,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _wrap(KernelFixture f, Widget child) => SizedBox(
|
|
width: 140,
|
|
child: harness(f, child),
|
|
);
|