fix(alarma-sonando): put the date line below the hero time
The prototype's order is pill (t4:415-416), then 7:30 at 88px (t4:417), then "Lunes, 3 de agosto" at 14px (t4:419). An earlier pass rendered the date between the pill and the time and cited "t4 line 419" as its justification -- but that line number is where the date SITS in the source, which is exactly why it comes last. Both the code and the test encoded the same misreading, so the test passed while the screen was wrong.
This commit is contained in:
@@ -99,8 +99,8 @@ void main() {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
});
|
||||
|
||||
testWidgets('visual fidelity (audit 9.4): the date line renders between the '
|
||||
'schedule pill and the hero time (t4:419)', (tester) async {
|
||||
testWidgets('visual fidelity (audit 9.4): the date line renders BELOW the '
|
||||
'hero time (t4:415-419: pill, then 7:30, then the date)', (tester) async {
|
||||
await _montarPantalla(tester);
|
||||
|
||||
final localeTag =
|
||||
@@ -111,16 +111,22 @@ void main() {
|
||||
|
||||
expect(find.text(esperado), findsOneWidget);
|
||||
|
||||
// Order: pill above the date line, date line above the hero time.
|
||||
// Order: pill, then the hero time, then the date line. This test used
|
||||
// to assert date-before-time and cited "t4:419" for it — but 419 is
|
||||
// simply the source line the date occupies, and in the prototype it
|
||||
// comes AFTER the 88px time on line 417. The citation refuted the
|
||||
// assertion it was supporting.
|
||||
final pillY =
|
||||
tester
|
||||
.getBottomLeft(find.byKey(const ValueKey('ringing-schedule-pill')))
|
||||
.dy;
|
||||
final dateY = tester.getTopLeft(find.text(esperado)).dy;
|
||||
final timeY =
|
||||
tester.getTopLeft(find.byKey(const ValueKey('ringing-hero-time'))).dy;
|
||||
expect(pillY <= dateY, isTrue);
|
||||
expect(dateY <= timeY, isTrue);
|
||||
tester
|
||||
.getBottomLeft(find.byKey(const ValueKey('ringing-hero-time')))
|
||||
.dy;
|
||||
final dateY = tester.getTopLeft(find.text(esperado)).dy;
|
||||
expect(pillY <= timeY, isTrue, reason: 'pill sits above the time');
|
||||
expect(timeY <= dateY, isTrue, reason: 'the date sits below the time');
|
||||
|
||||
// Regression guard: pumpAndSettle must still complete (purely
|
||||
// additive static text, no new animation).
|
||||
|
||||
Reference in New Issue
Block a user