From 0e481f25ffb01aad572d5592ea1e39415101f1a2 Mon Sep 17 00:00:00 2001 From: Joachim Rosskopf Date: Sun, 31 May 2026 06:41:51 +0200 Subject: [PATCH] test(explore): exercise event-pane re-open via real skill navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a faithful regression test for the skill-page event-pane chevron (fixed in #126): a real fixture + an actual navigation to a skill, so `currentPage` resolves async and `isSkill` flips through the real provider machinery (including the reset listener) before the chevron is tapped — closer to the live flow than the existing static-override test, and a guard against flicker-class regressions in the collapse state. Co-Authored-By: Claude Opus 4.8 --- .../test/crm/crm_workspace_test.dart | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/apps/escurel-explore/test/crm/crm_workspace_test.dart b/apps/escurel-explore/test/crm/crm_workspace_test.dart index 7c7b160..bb4c1f9 100644 --- a/apps/escurel-explore/test/crm/crm_workspace_test.dart +++ b/apps/escurel-explore/test/crm/crm_workspace_test.dart @@ -104,4 +104,40 @@ void main() { expect(find.bySemanticsLabel('region-events-collapse'), findsOneWidget); expect(find.bySemanticsLabel('event-pane'), findsOneWidget); }); + + testWidgets('navigate to a skill, then the chevron re-opens the event pane (real nav)', (tester) async { + // Closer to the live flow than the static override above: a real + // fixture and an actual navigation to a skill, so `currentPage` + // resolves async and `isSkill` flips through the real provider + // machinery (incl. the reset listener) before the chevron is tapped. + final client = _corpus(); + final container = ProviderContainer(overrides: [escurelClientProvider.overrideWithValue(client)]); + addTearDown(container.dispose); + + tester.view.physicalSize = const Size(1400, 900); + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + await tester.pumpWidget( + UncontrolledProviderScope( + container: container, + child: const MaterialApp(home: CrmWorkspace()), + ), + ); + await tester.pumpAndSettle(); + + // Navigate to the skill page (mirrors focusSkill setting currentPageId). + final resolved = await client.resolve('[[customer]]'); + expect(resolved.exists, isTrue); + container.read(currentPageIdProvider.notifier).state = resolved.pageId; + await tester.pumpAndSettle(); + + // Auto-minimized on the skill, then the chevron re-opens it. + expect(find.bySemanticsLabel('region-events-expand'), findsOneWidget); + expect(find.bySemanticsLabel('event-pane'), findsNothing); + await tester.tap(find.bySemanticsLabel('region-events-expand')); + await tester.pumpAndSettle(); + expect(find.bySemanticsLabel('region-events-collapse'), findsOneWidget); + expect(find.bySemanticsLabel('event-pane'), findsOneWidget); + }); }