Refactor architecture, fix all linter issues, and implement specification features (5 tabs, issue dropdowns, contact, info, search, pdf)

This commit is contained in:
2026-09-13 15:30:36 +02:00
parent 239f399af1
commit e6ce9c5012
24 changed files with 2486 additions and 1375 deletions
+37 -22
View File
@@ -1,30 +1,45 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:oggauergemeindetrommler/main.dart';
import 'package:oggauergemeindetrommler/models/post_item.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(const MyApp());
group('PostItem Model Tests', () {
test('creates PostItem with default values', () {
final now = DateTime.now();
final item = PostItem(
id: 'test-123',
title: 'Defekte Straßenlaterne',
description: 'Laterne vor Haus Nr. 12 leuchtet nicht mehr.',
imageUrl: 'https://example.com/test.jpg',
createdDate: now,
street: 'Hauptstraße',
category: 'Straßenbeleuchtung',
);
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
expect(item.id, 'test-123');
expect(item.title, 'Defekte Straßenlaterne');
expect(item.street, 'Hauptstraße');
expect(item.category, 'Straßenbeleuchtung');
expect(item.imageUrls.length, 1);
expect(item.status, 'Gemeldet');
});
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
test('serializes to Firestore map accurately', () {
final now = DateTime.now();
final item = PostItem(
id: 'test-456',
title: 'Müllablagerung am See',
description: 'Illegale Ablagerung am Parkplatz',
createdDate: now,
street: 'Hafen / Seebad',
category: 'Müll / Verunreinigung',
status: 'In Bearbeitung',
);
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
final map = item.toFirestore();
expect(map['title'], 'Müllablagerung am See');
expect(map['street'], 'Hafen / Seebad');
expect(map['category'], 'Müll / Verunreinigung');
expect(map['status'], 'In Bearbeitung');
});
});
}