-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marvin Frachet
committed
Apr 27, 2019
1 parent
d1a7bef
commit e06a85b
Showing
14 changed files
with
76 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import React from "react"; | ||
import { View } from "react-native"; | ||
import { shallow } from "enzyme"; | ||
import { stylify } from "../stylify"; | ||
import React from 'react'; | ||
import { View } from 'react-native'; | ||
import { shallow } from 'enzyme'; | ||
import { stylify } from '../stylify'; | ||
|
||
describe("stylify", () => { | ||
describe('stylify', () => { | ||
let computeStyle; | ||
let Component; | ||
|
||
beforeEach(() => { | ||
computeStyle = () => ({ backgroundColor: "red" }); | ||
computeStyle = () => ({ backgroundColor: 'red' }); | ||
Component = props => <View {...props} />; | ||
}); | ||
|
||
it("should inject the passed style merged with the computed ones", () => { | ||
it('should inject the passed style merged with the computed ones', () => { | ||
const StyledComponent = stylify(computeStyle)(Component); | ||
const wrapper = shallow(<StyledComponent style={{ marginLeft: 100 }} />); | ||
|
||
expect(wrapper.find(Component).prop("style")).toEqual({ | ||
expect(wrapper.find(Component).prop('style')).toEqual({ | ||
marginLeft: 100, | ||
backgroundColor: "red" | ||
backgroundColor: 'red', | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { View } from "react-native"; | ||
import { stylify } from "./stylify"; | ||
import computeStyleMedia from "./media/media.style"; | ||
import computeStyleBox from "./box/box.style"; | ||
import { View } from 'react-native'; | ||
import { stylify } from './stylify'; | ||
import computeStyleMedia from './media/media.style'; | ||
import computeStyleBox from './box/box.style'; | ||
|
||
export const Media = stylify(computeStyleMedia)(View); | ||
export const Box = stylify(computeStyleBox)(View); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters