feat: add setting for auto-lock fix: fix sideswipe
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user