feat: add alot

This commit is contained in:
2026-10-08 04:12:36 +02:00
parent ccf5165417
commit fc607cb7bd
99 changed files with 4981 additions and 3655 deletions
+2 -55
View File
@@ -1,6 +1,6 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:kooltab2/models/bar_tab.dart';
import 'package:kooltab2/models/tab_item.dart';
import 'package:kooltap/models/bar_tab.dart';
import 'package:kooltap/models/tab_item.dart';
void main() {
group('BarTab', () {
@@ -9,7 +9,6 @@ void main() {
final tab = BarTab(
id: 'tab-1',
customerName: 'John',
status: 'open',
openedAt: DateTime.now(),
items: [
const TabItem(
@@ -38,7 +37,6 @@ void main() {
final tab = BarTab(
id: 'tab-1',
customerName: 'John',
status: 'open',
openedAt: DateTime.now(),
items: const [],
);
@@ -52,7 +50,6 @@ void main() {
final tab = BarTab(
id: 'tab-1',
customerName: 'John',
status: 'open',
openedAt: DateTime.now(),
items: [
const TabItem(
@@ -81,7 +78,6 @@ void main() {
final tab = BarTab(
id: 'tab-1',
customerName: 'John',
status: 'open',
openedAt: DateTime.now(),
items: const [],
);
@@ -89,54 +85,5 @@ void main() {
expect(tab.itemCount, 0);
});
});
group('formattedTotal', () {
test('formats total with euro symbol', () {
final tab = BarTab(
id: 'tab-1',
customerName: 'John',
status: 'open',
openedAt: DateTime.now(),
items: const [
TabItem(
id: 'item-1',
tabId: 'tab-1',
productId: 'prod-1',
productName: 'Beer',
quantity: 2,
unitPriceInCents: 425,
),
],
);
expect(tab.formattedTotal, '€8.50');
});
});
group('isOpen', () {
test('returns true for open status', () {
final tab = BarTab(
id: 'tab-1',
customerName: 'John',
status: 'open',
openedAt: DateTime.now(),
items: const [],
);
expect(tab.isOpen, true);
});
test('returns false for closed status', () {
final tab = BarTab(
id: 'tab-1',
customerName: 'John',
status: 'closed',
openedAt: DateTime.now(),
items: const [],
);
expect(tab.isOpen, false);
});
});
});
}