feat: add alot
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user