mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-03-27 01:34:17 +08:00
Fix tests and code style
This commit is contained in:
@@ -53,7 +53,7 @@ class Example extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<View style={styles.root} accessibilityRole='main'>
|
||||
<View accessibilityRole='main' style={styles.root}>
|
||||
<Heading level='1' size='xlarge'>React Native for Web: examples</Heading>
|
||||
|
||||
<Heading level='2' size='large'>Image</Heading>
|
||||
|
||||
@@ -17,7 +17,8 @@ const styles = {
|
||||
initial: {
|
||||
alignSelf: 'flex-start',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
backgroundPosition: 'center'
|
||||
backgroundPosition: 'center',
|
||||
backgroundSize: '100% 100%'
|
||||
},
|
||||
img: {
|
||||
borderWidth: 0,
|
||||
@@ -187,8 +188,8 @@ class Image extends React.Component {
|
||||
*/
|
||||
return (
|
||||
<View
|
||||
accessible={accessible}
|
||||
accessibilityLabel={accessibilityLabel}
|
||||
accessible={accessible}
|
||||
className={'Image'}
|
||||
component='div'
|
||||
role='img'
|
||||
|
||||
@@ -5,8 +5,6 @@ import React from 'react/addons'
|
||||
import Image from '.'
|
||||
import View from '../View'
|
||||
|
||||
const ReactTestUtils = React.addons.TestUtils
|
||||
|
||||
suite('Image', () => {
|
||||
test('defaults', () => {
|
||||
const result = shallowRender(<Image />)
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { assertProps, render, renderToDOM, shallowRender } from '../../modules/specHelpers'
|
||||
import { assertProps, shallowRender } from '../../modules/specHelpers'
|
||||
import assert from 'assert'
|
||||
import React from 'react/addons'
|
||||
|
||||
import View from '.'
|
||||
|
||||
const ReactTestUtils = React.addons.TestUtils
|
||||
|
||||
suite('View', () => {
|
||||
test('prop "accessibilityLabel"', () => {
|
||||
assertProps.accessibilityLabel(View)
|
||||
|
||||
@@ -93,9 +93,9 @@ export const assertProps = {
|
||||
}
|
||||
|
||||
export function render(element, container) {
|
||||
return container ?
|
||||
React.render(element, container) :
|
||||
ReactTestUtils.renderIntoDocument(element)
|
||||
return container
|
||||
? React.render(element, container)
|
||||
: ReactTestUtils.renderIntoDocument(element)
|
||||
}
|
||||
|
||||
export function renderToDOM(element, container) {
|
||||
|
||||
@@ -247,6 +247,7 @@
|
||||
|
||||
/* cursor */
|
||||
|
||||
.cursor-default { cursor: default; }
|
||||
.cursor-pointer { cursor: pointer; }
|
||||
|
||||
/* direction */
|
||||
|
||||
Reference in New Issue
Block a user