Skip to content

Commit 64956b0

Browse files
Remove unnecessary test
1 parent f797f58 commit 64956b0

1 file changed

Lines changed: 0 additions & 67 deletions

File tree

test/over_react_redux/connect_flux_test.dart

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
import 'package:over_react/over_react.dart';
1616
import 'package:over_react/over_react_flux.dart';
1717
import 'package:over_react/over_react_redux.dart';
18-
import 'package:redux/redux.dart' as redux;
1918
import 'package:test/test.dart';
2019

2120
import '../test_util/test_util.dart';
2221
import 'fixtures/connect_flux_counter.dart';
2322
import 'fixtures/connect_flux_store.dart';
24-
import 'fixtures/counter.dart';
2523
import 'fixtures/non_component_two_counter.dart';
2624
import 'fixtures/redux_actions.dart';
27-
import 'fixtures/store.dart' as redux_store;
2825

2926
// ignore_for_file: avoid_types_on_closure_parameters
3027

@@ -466,70 +463,6 @@ main() {
466463

467464
expect(jacket.mountNode.innerHtml, contains('Count: 0'));
468465
});
469-
470-
test(
471-
'matches a standard Redux component when `areStatesEqual` is false',
472-
() async {
473-
final localReduxRef = createRef<CounterComponent>();
474-
475-
final ReduxConnectedCounter =
476-
connect<redux_store.CounterState, CounterProps>(
477-
mapStateToProps: (state) {
478-
methodsCalled.add({'called': 'mapStateToProps'});
479-
return ConnectFluxCounter()..currentCount = state.count;
480-
},
481-
areStatePropsEqual: (next, prev) {
482-
methodsCalled.add({
483-
'called': 'areStatePropsEqual',
484-
'prev': prev,
485-
'next': next,
486-
});
487-
// Force it to always be true, meaning it shouldn't re-render if they change.
488-
return true;
489-
},
490-
forwardRef: true,
491-
areStatesEqual: (_, __) => false,
492-
)(Counter);
493-
494-
final reduxStore = redux.Store(redux_store.counterStateReducer,
495-
initialState: redux_store.CounterState());
496-
497-
jacket = mount(
498-
(ReduxProvider()..store = reduxStore)(
499-
(ReduxConnectedCounter()..ref = localReduxRef)('test'),
500-
),
501-
);
502-
503-
// Because `areStatesEqual` is false, we expect additional method calls
504-
expect(methodsCalled.map((methodObj) => methodObj['called']),
505-
expectedMountMethodCalls);
506-
for (final methodCall in methodsCalled) {
507-
if (methodCall['called'] == 'areStatePropsEqual') {
508-
expect(methodCall['prev'], isA<CounterProps>());
509-
expect(methodCall['next'], isA<CounterProps>());
510-
}
511-
}
512-
methodsCalled.clear();
513-
514-
var dispatchButton =
515-
queryByTestId(jacket.mountNode, 'button-increment');
516-
click(dispatchButton);
517-
518-
// wait for the next tick for the async dispatch to propagate
519-
await Future(() {});
520-
521-
// store.state.count should be 1 but does not re-render due to override in `areStatePropsEqual`
522-
expect(expectedUpdateMethodCalls, methodsCalled.map((methodObj) => methodObj['called']).toList(),
523-
reason: 'expectedUpdateMethodCalls should match connect\'s sequence of calls');
524-
for (final methodCall in methodsCalled) {
525-
if (methodCall['called'] == 'areStatePropsEqual') {
526-
expect(methodCall['prev'], isA<CounterProps>());
527-
expect(methodCall['next'], isA<CounterProps>());
528-
}
529-
}
530-
531-
expect(jacket.mountNode.innerHtml, contains('Count: 0'));
532-
});
533466
});
534467

535468
group('areMergedPropsEqual', () {

0 commit comments

Comments
 (0)