Skip to content

MobileFix - Testing: Golden tests for critical widgets (Part 2 of 4) #3214

@palisadoes

Description

@palisadoes

Problem Statement

Missing golden tests for critical widgets.

Files to Modify / Create (static targets)

  • test/goldens/**
  • test/goldens/golden_test.dart

Files to Modify / Create (detected for this PR)

  • lib/widgets/custom_progress_dialog.dart
  • lib/widgets/custom_weekday_selector.dart
  • lib/widgets/date_time_picker.dart
  • lib/widgets/directly_login.dart
  • lib/widgets/event_card.dart
  • lib/widgets/event_date_time_tile.dart
  • lib/widgets/from_palisadoes.dart
  • lib/widgets/fund_build_info_row.dart
  • lib/widgets/interaction.dart
  • lib/widgets/lang_switch.dart

Proposed Solution

Implement within MVVM + Provider + GetIt; avoid large rewrites. Keep changes scoped to the listed files.

Implementation Approach

  1. Update only the files listed above (<= 10 in this PR).
  2. Add/adjust tests accordingly; keep CI green.
  3. If more files are needed, open follow-up PRs.

Acceptance Criteria

  • All listed files updated
  • Tests added/updated (>= 80% for changed units)
  • CI passing
  • Docs updated if applicable

Starter Code

Starter Code

// test/goldens/golden_test.dart
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
Widget themed(Widget c,ThemeMode m)=>MaterialApp(themeMode:m,theme:ThemeData.light(),darkTheme:ThemeData.dark(),home:c);
void main(){
  testWidgets('MyWidget golden', (t) async{
    await t.pumpWidget(themed(const Placeholder(), ThemeMode.light));
    await expectLater(find.byType(Placeholder), matchesGoldenFile('mywidget_light.png'));
  });
}

Dependencies

Phase

P2 - High Impact

Metadata

Metadata

Labels

dartPull requests that update Dart codedependenciesPull requests that update a dependency filegood first issueGood for newcomersno-issue-activityNo issue activityrefactorRefactor the code to improve its qualitysecuritySecurity fixtestTesting applicationunapprovedUnapproved, needs to be triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions