feat: make server owner of tabs
This commit is contained in:
@@ -4,7 +4,6 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:kooltap/models/bar_tab.dart';
|
||||
import 'package:kooltap/models/tab_item.dart';
|
||||
import 'package:kooltap/services/bar_tab_service.dart';
|
||||
import 'package:kooltap/services/product_service.dart';
|
||||
import 'package:kooltap/viewmodels/bar_screen_view_model.dart';
|
||||
import 'package:mocktail/mocktail.dart';
|
||||
|
||||
@@ -87,7 +86,7 @@ void main() {
|
||||
expect(viewModel.isLoading, false);
|
||||
});
|
||||
|
||||
test('propagates an insufficient-stock error from the transaction', () async {
|
||||
test('propagates an error from the transaction', () async {
|
||||
const item = TabItem(
|
||||
id: 'item-1',
|
||||
tabId: 'tab-1',
|
||||
@@ -99,11 +98,11 @@ void main() {
|
||||
|
||||
when(
|
||||
() => barTabService.adjustTabItemQuantity(tabItemId: 'item-1', delta: 1),
|
||||
).thenAnswer((_) async => throw const InsufficientStockException());
|
||||
).thenAnswer((_) async => throw const TabNotFoundException('tab-1'));
|
||||
|
||||
await expectLater(
|
||||
viewModel.changeItemQuantity(item, 1),
|
||||
throwsA(isA<InsufficientStockException>()),
|
||||
throwsA(isA<TabNotFoundException>()),
|
||||
);
|
||||
|
||||
expect(viewModel.loadError, isNull);
|
||||
|
||||
Reference in New Issue
Block a user