fix(build): FIx linting and react errors and popover spec

This commit is contained in:
Juan Tejada 2016-03-31 16:10:09 -07:00
parent 91b2d5b8e3
commit bec4a86629
4 changed files with 10 additions and 7 deletions

View file

@ -1,4 +1,5 @@
import React from 'react';
import {findDOMNode} from 'react-dom';
import {Actions} from 'nylas-exports';
import {RetinaImg, ScrollRegion} from 'nylas-component-kit';
@ -234,7 +235,7 @@ class EmojiButtonPopover extends React.Component {
}
renderCanvas() {
const canvas = React.findDOMNode(this.refs.emojiCanvas);
const canvas = findDOMNode(this.refs.emojiCanvas);
const keys = Object.keys(this.state.categoryPositions);
canvas.height = this.state.categoryPositions[keys[keys.length - 1]].bottom * 2;
const ctx = canvas.getContext("2d");

View file

@ -1,4 +1,5 @@
import React, {addons} from 'react/addons';
import {findDOMNode} from 'react-dom';
import {renderIntoDocument} from '../../../spec/nylas-test-utils';
import Contenteditable from '../../../src/components/contenteditable/contenteditable';
import EmojiButtonPopover from '../lib/emoji-button-popover';
@ -21,12 +22,12 @@ describe('EmojiButtonPopover', ()=> {
onChange={jasmine.createSpy('onChange')}
extensions={[EmojiComposerExtension]} />
);
this.editableNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithAttr(this.composer, 'contentEditable'));
this.editableNode = findDOMNode(ReactTestUtils.findRenderedDOMComponentWithAttr(this.composer, 'contentEditable'));
this.editableNode.innerHTML = "Testing!";
const sel = document.getSelection()
const textNode = this.editableNode.childNodes[0];
sel.setBaseAndExtent(textNode, textNode.nodeValue.length, textNode, textNode.nodeValue.length);
this.canvas = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(this.component, 'canvas'));
this.canvas = findDOMNode(ReactTestUtils.findRenderedDOMComponentWithTag(this.component, 'canvas'));
});
describe('when inserting emoji', ()=> {
@ -54,7 +55,7 @@ describe('EmojiButtonPopover', ()=> {
describe('when searching for emoji', ()=> {
it('should filter for matches', ()=> {
this.searchNode = React.findDOMNode(ReactTestUtils.findRenderedDOMComponentWithClass(this.component, 'search'))
this.searchNode = findDOMNode(ReactTestUtils.findRenderedDOMComponentWithClass(this.component, 'search'))
const event = {
target: {
value: "heart",

View file

@ -120,7 +120,7 @@ class FixedPopover extends Component {
onBlur = (event)=> {
const target = event.nativeEvent.relatedTarget;
if (!target || (!React.findDOMNode(this).contains(target))) {
if (!target || (!findDOMNode(this).contains(target))) {
Actions.closePopover();
}
};
@ -142,12 +142,14 @@ class FixedPopover extends Component {
}
};
static Directions = Directions;
focusElementWithTabIndex = ()=> {
if (!this.mounted) {
return;
}
// Automatically focus the element inside us with the lowest tab index
const popoverNode = React.findDOMNode(this);
const popoverNode = findDOMNode(this);
// _.sortBy ranks in ascending numerical order.
const focusable = popoverNode.querySelectorAll("[tabIndex], input");

View file

@ -1,6 +1,5 @@
import _ from 'underscore';
import Message from '../models/message';
import MessageUtils from '../models/message-utils';
import MessageStore from './message-store';
import DatabaseStore from './database-store';