Skip to content

Commit

Permalink
Remove SubscribableMixin from SizeFlexibilityUpdateTest (facebook#21580)
Browse files Browse the repository at this point in the history
Summary:
Related to facebook#21485

Remove SubscribableMixin from SizeFlexibilityUpdateTest

- All flow tests succeed.
- yarn run test-android-instrumentation && CI integration tests

[GENERAL] [ENHANCEMENT] [SizeFlexibilityUpdateTest.js] - rm SubscribableMixin
Pull Request resolved: facebook#21580

Reviewed By: TheSavior

Differential Revision: D10276267

Pulled By: RSNara

fbshipit-source-id: fc89b43099c788cba560c9aaf0819cd5cfab38c3
  • Loading branch information
exced authored and facebook-github-bot committed Oct 10, 2018
1 parent 4b6f02e commit 4b8c657
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions IntegrationTests/SizeFlexibilityUpdateTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/

'use strict';
Expand All @@ -13,10 +14,10 @@ const React = require('react');
const createReactClass = require('create-react-class');
const ReactNative = require('react-native');
const RCTNativeAppEventEmitter = require('RCTNativeAppEventEmitter');
const Subscribable = require('Subscribable');
const {View} = ReactNative;

const {TestModule} = ReactNative.NativeModules;
import type EmitterSubscription from 'EmitterSubscription';

const reactViewWidth = 111;
const reactViewHeight = 222;
Expand All @@ -25,16 +26,21 @@ let finalState = false;

const SizeFlexibilityUpdateTest = createReactClass({
displayName: 'SizeFlexibilityUpdateTest',
mixins: [Subscribable.Mixin],
_subscription: (null: ?EmitterSubscription),

UNSAFE_componentWillMount: function() {
this.addListenerOn(
RCTNativeAppEventEmitter,
this._subscription = RCTNativeAppEventEmitter.addListener(
'rootViewDidChangeIntrinsicSize',
this.rootViewDidChangeIntrinsicSize,
);
},

componentWillUnmount: function() {
if (this._subscription != null) {
this._subscription.remove();
}
},

markPassed: function() {
TestModule.markTestPassed(true);
finalState = true;
Expand Down

0 comments on commit 4b8c657

Please sign in to comment.