/* @flow */
'use strict';

import Emission from 'emission';
import React from 'react-native';
const { TestModule } = React.NativeModules;

class OpaqueImageViewTest extends React.Component {
  constructor() {
    super();
    this.createSnapshot = this.createSnapshot.bind(this);
  }

  createSnapshot() {
    if (!TestModule.verifySnapshot) {
      throw new Error('TestModule.verifySnapshot not defined.');
    }
    TestModule.verifySnapshot(this.done);
  }

  done(success) {
    TestModule.markTestPassed(success);
  }

  render() {
    return <Emission.Components.OpaqueImageView {...this.props} onLoad={this.createSnapshot} />
  }
}

React.AppRegistry.registerComponent('OpaqueImageView', () => OpaqueImageViewTest);

@@ -190,115 +190,13 @@
 %7B%0A  
-constructor() %7B%0A    super();%0A    this.createSnapshot = this.createSnapshot.bind(this);%0A  %7D%0A%0A  createSnapsho
+asser
 t() 
@@ -340,47 +340,8 @@
 hot(
-this.done);%0A  %7D%0A%0A  done(success) %7B%0A    
 Test
@@ -365,16 +365,8 @@
 ssed
-(success
 );%0A 
@@ -463,21 +463,13 @@
 his.
-createSnapsho
+asser
 t%7D /

Simplify test a bit.