feat: add setting for auto-lock fix: fix sideswipe

This commit is contained in:
2026-08-04 01:09:01 +02:00
parent 0997d110d4
commit 812fcc892b
23 changed files with 629 additions and 28 deletions
+34
View File
@@ -136,6 +136,40 @@ void main() {
});
});
group('renameTab', () {
test('updates the tab customer name', () async {
final tab = await service.createTab(customerName: 'John');
await service.renameTab(tabId: tab.id, customerName: ' Jane ');
final updatedTab = await service.getTabById(tab.id);
expect(updatedTab!.customerName, 'Jane');
});
});
group('deleteTab', () {
test('deletes the tab and restores item stock', () async {
final tab = await service.createTab(customerName: 'John');
final product = createTestProduct();
await service.addProductToTab(tabId: tab.id, product: product);
await service.addProductToTab(tabId: tab.id, product: product);
final deletedItems = await service.deleteTab(tab.id);
expect(deletedItems.length, 1);
expect(deletedItems.first.quantity, 2);
expect(await service.getTabById(tab.id), isNull);
final updatedProduct = await (database.select(
database.products,
)..where((row) => row.id.equals(product.id))).getSingle();
expect(updatedProduct.stockQuantity, 100);
final remainingItems = await database.select(database.tabItems).get();
expect(remainingItems, isEmpty);
});
});
group('addProductToTab', () {
test('adds new product to tab', () async {
final tab = await service.createTab(customerName: 'John');