Files
inKino/core/test/redux/show_reducer_test.dart
Pascal Welsch 6f2ebec976 Use immutable collections from kt.dart (#112)
* Use immutable collections in core interfaces

* Convert theaters to kt_dart

* Convert mobile to kt_dart

* Covert web to kt_dart

* Combine movies with same original title correctly
2019-01-19 10:32:20 +01:00

37 lines
983 B
Dart

import 'package:core/src/redux/show/show_actions.dart';
import 'package:core/src/redux/show/show_reducer.dart';
import 'package:core/src/redux/show/show_state.dart';
import 'package:kt_dart/collection.dart';
import 'package:test/test.dart';
void main() {
group('ShowReducer', () {
test(
'when called with ShowDatesUpdatedAction, should update state with 7 days from today',
() {
final initialState = ShowState.initial();
final reducedState = showReducer(
initialState,
ShowDatesUpdatedAction(
listOf(
DateTime(2018, 1, 1),
DateTime(2018, 1, 2),
),
),
);
expect(
reducedState.dates,
listOf(
DateTime(2018, 1, 1),
DateTime(2018, 1, 2),
),
);
// Should also select the first date in the list
expect(reducedState.selectedDate, DateTime(2018, 1, 1));
},
);
});
}