feat: 实现日历提醒 in-app fallback 机制及通知服务重构
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:social_app/features/home/ui/controllers/home_keyboard_inset_calculator.dart';
|
||||
|
||||
void main() {
|
||||
test('subtracts bottom safe area from keyboard inset', () {
|
||||
final inset = HomeKeyboardInsetCalculator.compute(
|
||||
rawViewInsetBottom: 336,
|
||||
bottomViewPadding: 34,
|
||||
);
|
||||
|
||||
expect(inset, 302);
|
||||
});
|
||||
|
||||
test('returns zero when keyboard is effectively hidden', () {
|
||||
final inset = HomeKeyboardInsetCalculator.compute(
|
||||
rawViewInsetBottom: 6,
|
||||
bottomViewPadding: 34,
|
||||
);
|
||||
|
||||
expect(inset, 0);
|
||||
});
|
||||
|
||||
test('follows keyboard fallback immediately when inset decreases', () {
|
||||
final openedInset = HomeKeyboardInsetCalculator.compute(
|
||||
rawViewInsetBottom: 336,
|
||||
bottomViewPadding: 34,
|
||||
);
|
||||
final collapsedInset = HomeKeyboardInsetCalculator.compute(
|
||||
rawViewInsetBottom: 120,
|
||||
bottomViewPadding: 34,
|
||||
);
|
||||
|
||||
expect(openedInset, 302);
|
||||
expect(collapsedInset, 86);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user