fix:设备查询菜品频繁问题
fix:退看流水对账问题
This commit is contained in:
1 parent
917e7b4e83
commit
4d7bc5ed33
12 files changed
+137
-32
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
|
||||
/// 验证每日菜谱单日与范围接口共用的日期字段能够稳定映射到终端商品模型。
|
||||
void main() {
|
||||
test('每日菜谱 startTime 映射为本地供应日期', () {
|
||||
final product = ServiceProduct.fromJson({
|
||||
'spuId': '1001',
|
||||
'startTime': '2026-09-02',
|
||||
});
|
||||
|
||||
expect(product.saleDate, DateTime(2026, 9, 2));
|
||||
expect(product.toJson()['startTime'], '2026-09-02T00:00:00.000');
|
||||
expect(product.toJson().containsKey('saleDate'), isFalse);
|
||||
});
|
||||
}
|
||||
@@ -2,15 +2,15 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
|
||||
/// 验证商品同步任务使用既有调度器,并按五分钟周期等待终端空闲后自动执行。
|
||||
/// 验证商品同步任务使用既有调度器,并按三小时周期等待终端空闲后自动执行。
|
||||
void main() {
|
||||
test('商品同步默认开启且每五分钟仅空闲执行', () {
|
||||
test('商品同步默认开启且每三小时仅空闲执行', () {
|
||||
final config = SyncCheckTool.defaultConfigs.singleWhere(
|
||||
(item) => item.type == ScheduledTaskType.productSync,
|
||||
);
|
||||
|
||||
expect(config.enabled, isTrue);
|
||||
expect(config.cron, '0 */5 * * * *');
|
||||
expect(config.cron, '0 0 */3 * * *');
|
||||
expect(config.idleOnly, isTrue);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user