feat: Implement husband features and fix iOS Safari web startup
Implement initial features for husband's companion app, including mock data service and husband notes screen. Refactor scripture and cycle services for improved stability and testability. Address iOS Safari web app startup issue by removing deprecated initialization. - Implemented MockDataService and HusbandNotesScreen. - Converted _DashboardTab and DevotionalScreen to StatefulWidgets for robust scripture provider initialization. - Refactored CycleService to use immutable CycleInfo class, reducing UI rebuilds. - Removed deprecated window.flutterConfiguration from index.html, resolving Flutter web app startup failure on iOS Safari. - Updated and fixed related tests.
This commit is contained in:
@@ -7,8 +7,8 @@ void main() {
|
||||
group('CycleService Tests', () {
|
||||
test('calculateCycleInfo returns follicular phase for null profile', () {
|
||||
final info = CycleService.calculateCycleInfo(null);
|
||||
expect(info['phase'], CyclePhase.follicular);
|
||||
expect(info['dayOfCycle'], 1);
|
||||
expect(info.phase, CyclePhase.follicular);
|
||||
expect(info.dayOfCycle, 1);
|
||||
});
|
||||
|
||||
test('calculateCycleInfo calculates follicular phase correctly (Day 7)', () {
|
||||
@@ -26,8 +26,8 @@ void main() {
|
||||
);
|
||||
|
||||
final info = CycleService.calculateCycleInfo(user);
|
||||
expect(info['dayOfCycle'], 7);
|
||||
expect(info['phase'], CyclePhase.follicular);
|
||||
expect(info.dayOfCycle, 7);
|
||||
expect(info.phase, CyclePhase.follicular);
|
||||
});
|
||||
|
||||
test('calculateCycleInfo calculates menstrual phase correctly (Day 2)', () {
|
||||
@@ -45,8 +45,8 @@ void main() {
|
||||
);
|
||||
|
||||
final info = CycleService.calculateCycleInfo(user);
|
||||
expect(info['dayOfCycle'], 2);
|
||||
expect(info['phase'], CyclePhase.menstrual);
|
||||
expect(info.dayOfCycle, 2);
|
||||
expect(info.phase, CyclePhase.menstrual);
|
||||
});
|
||||
|
||||
test('calculateCycleInfo handles cycle length wrapping', () {
|
||||
@@ -65,8 +65,8 @@ void main() {
|
||||
);
|
||||
|
||||
final info = CycleService.calculateCycleInfo(user);
|
||||
expect(info['dayOfCycle'], 3);
|
||||
expect(info['phase'], CyclePhase.menstrual);
|
||||
expect(info.dayOfCycle, 3);
|
||||
expect(info.phase, CyclePhase.menstrual);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user