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