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.
32 lines
990 B
32 lines
990 B
import 'package:flutter/material.dart';
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:redux/redux.dart';
|
|
import 'package:thesis_shop/models/remote_resource.dart';
|
|
import 'package:thesis_shop/redux/state.dart';
|
|
import 'package:thesis_shop/screens/cart/total_price_text.dart';
|
|
|
|
class AppStateMock extends AppState {
|
|
AppStateMock()
|
|
: super(
|
|
isSignedIn: false,
|
|
remoteProducts: const RemoteResource.loading(),
|
|
productQuantities: {});
|
|
@override
|
|
double get totalPrice => 10.0;
|
|
}
|
|
|
|
void main() {
|
|
testWidgets('test total price text', (tester) async {
|
|
final store = Store<AppState>((s, _) => s, initialState: AppStateMock());
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
home: StoreProvider<AppState>(
|
|
store: store,
|
|
child: const TotalPriceText(),
|
|
),
|
|
),
|
|
);
|
|
expect(find.text('Gesamtpreis: 10.00€'), findsOneWidget);
|
|
});
|
|
}
|
|
|