mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-21 19:12:13 +08:00
Initial StyleSheet implementation for Web. Converts style object declarations to "atomic" CSS rules. Close gh-25
34 lines
607 B
JavaScript
34 lines
607 B
JavaScript
/* eslint-env mocha */
|
|
|
|
import assert from 'assert'
|
|
import getStyleObjects from '../getStyleObjects'
|
|
|
|
const fixture = {
|
|
rule: {
|
|
margin: 0,
|
|
padding: 0
|
|
},
|
|
nested: {
|
|
auto: {
|
|
backgroundSize: 'auto'
|
|
},
|
|
contain: {
|
|
backgroundSize: 'contain'
|
|
}
|
|
},
|
|
ignored: {
|
|
pading: 0
|
|
}
|
|
}
|
|
|
|
suite('modules/StyleSheet/getStyleObjects', () => {
|
|
test('returns only style objects', () => {
|
|
const actual = getStyleObjects(fixture)
|
|
assert.deepEqual(actual, [
|
|
{ margin: 0, padding: 0 },
|
|
{ backgroundSize: 'auto' },
|
|
{ backgroundSize: 'contain' }
|
|
])
|
|
})
|
|
})
|