You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
767 B
26 lines
767 B
// ignore_for_file: unnecessary_cast
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:thesis_shop/screens/cart/total_price_text.dart';
|
|
import 'package:thesis_shop/store/cart_store.dart';
|
|
|
|
class CartStoreMock extends CartStore {
|
|
@override
|
|
double get totalPrice => 10.0;
|
|
}
|
|
|
|
void main() {
|
|
testWidgets('test total price', (tester) async {
|
|
final widgetTree = MaterialApp(
|
|
home: ChangeNotifierProvider.value(
|
|
value: CartStoreMock() as CartStore,
|
|
child: const TotalPriceText(),
|
|
),
|
|
);
|
|
await tester.pumpWidget(widgetTree);
|
|
final correctText = find.text("Gesamtpreis: 10.00€");
|
|
expect(correctText, findsOneWidget);
|
|
});
|
|
}
|
|
|