-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
15 changed files
with
251 additions
and
235 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = function(api) { | ||
api.cache(true); | ||
return { | ||
presets: ['babel-preset-expo'], | ||
presets: ["babel-preset-expo"], | ||
}; | ||
}; |
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,4 +1,4 @@ | ||
module.exports = { | ||
presets: ['module:metro-react-native-babel-preset'], | ||
plugins: [['@babel/plugin-transform-private-methods', {loose: true}]], | ||
presets: ["module:metro-react-native-babel-preset"], | ||
plugins: [["@babel/plugin-transform-private-methods", { loose: true }]], | ||
}; |
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,3 +1,3 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
extends: ["@commitlint/config-conventional"], | ||
}; |
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,69 +1,69 @@ | ||
/* eslint max-len: 0 */ | ||
|
||
import 'react-native'; | ||
import {Image} from 'react-native'; | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import "react-native"; | ||
import { Image } from "react-native"; | ||
import React from "react"; | ||
import renderer from "react-test-renderer"; | ||
|
||
import UserAvatar from '../'; | ||
import UserAvatar from "../"; | ||
|
||
it('should render <UserAvatar /> without anything, default values', () => { | ||
it("should render <UserAvatar /> without anything, default values", () => { | ||
const tree = renderer.create(<UserAvatar />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render <UserAvatar /> with name, without src, default values', () => { | ||
it("should render <UserAvatar /> with name, without src, default values", () => { | ||
const tree = renderer.create(<UserAvatar name="Bhav Beri" />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render <UserAvatar /> with name, with src', () => { | ||
it("should render <UserAvatar /> with name, with src", () => { | ||
jest.useFakeTimers(); | ||
const tree = renderer | ||
.create( | ||
<UserAvatar | ||
name="Bhav Beri" | ||
src="https://dummyimage.com/100x100/000/fff" | ||
/>, | ||
) | ||
.toJSON(); | ||
.create( | ||
<UserAvatar | ||
name="Bhav Beri" | ||
src="https://dummyimage.com/100x100/000/fff" | ||
/>, | ||
) | ||
.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render <UserAvatar /> with name, if src is not an image', () => { | ||
it("should render <UserAvatar /> with name, if src is not an image", () => { | ||
jest.useFakeTimers(); | ||
const tree = renderer | ||
.create( | ||
<UserAvatar | ||
name="Bhav Beri" | ||
src="https://github.com/bhavberi/react-native-user-avatar/" | ||
/>, | ||
) | ||
.toJSON(); | ||
.create( | ||
<UserAvatar | ||
name="Bhav Beri" | ||
src="https://github.com/bhavberi/react-native-user-avatar/" | ||
/>, | ||
) | ||
.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('should warn because size is not number', () => { | ||
it("should warn because size is not number", () => { | ||
const tree = renderer | ||
.create(<UserAvatar name="Bhav Beri" size="100" />) | ||
.toJSON(); | ||
.create(<UserAvatar name="Bhav Beri" size="100" />) | ||
.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('should render <UserAvatar /> with name, with custom component', () => { | ||
it("should render <UserAvatar /> with name, with custom component", () => { | ||
const tree = renderer | ||
.create( | ||
<UserAvatar | ||
name="Bhav Beri" | ||
component={ | ||
<Image | ||
source={require('./images/rn_logo.png')} | ||
style={{width: 50, height: 50}} | ||
/> | ||
} | ||
size={100} | ||
/>, | ||
) | ||
.toJSON(); | ||
.create( | ||
<UserAvatar | ||
name="Bhav Beri" | ||
component={ | ||
<Image | ||
source={require("./images/rn_logo.png")} | ||
style={{ width: 50, height: 50 }} | ||
/> | ||
} | ||
size={100} | ||
/>, | ||
) | ||
.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); |
Oops, something went wrong.