Skip to content

Instantly share code, notes, and snippets.

View adrian-afergon's full-sized avatar
🏠
Working from home

Adrián Ferrera González adrian-afergon

🏠
Working from home
View GitHub Profile
@adrian-afergon
adrian-afergon / App.js
Created August 17, 2018 16:07
Create TextInput on view
import React from 'react';
import { StyleSheet, Text, View, Button, TextInput } from 'react-native';
export default class App extends React.Component {
constructor(props) {
super(props);
}
render() {
@adrian-afergon
adrian-afergon / App.test.js
Created August 17, 2018 16:06
Create a test for find a InputText
import React from 'react';
import App from './App';
import renderer from 'react-test-renderer';
import Adapter from 'enzyme-adapter-react-16'
import { shallow, configure } from 'enzyme';
configure({ adapter: new Adapter() });
it('renders without crashing', () => {
@adrian-afergon
adrian-afergon / App.test.js
Created August 16, 2018 15:42
Add mock to test App.test.js
import React from 'react';
import App from './App';
import renderer from 'react-test-renderer';
import Adapter from 'enzyme-adapter-react-16'
import { shallow, configure } from 'enzyme';
configure({ adapter: new Adapter() });
it('renders without crashing', () => {
@adrian-afergon
adrian-afergon / App.js
Created August 16, 2018 15:36
Add injectable method
import React from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
export default class App extends React.Component {
constructor(props) {
super(props);
}
render() {
@adrian-afergon
adrian-afergon / App.js
Created August 15, 2018 18:24
Event click change view
import React from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {text: 'Hello World'};
}
@adrian-afergon
adrian-afergon / App.test.js
Created August 15, 2018 17:58
Add test for simulate press
import React from 'react';
import App from './App';
import renderer from 'react-test-renderer';
import Adapter from 'enzyme-adapter-react-16'
import { shallow, configure } from 'enzyme';
configure({ adapter: new Adapter() });
it('renders without crashing', () => {
@adrian-afergon
adrian-afergon / App.js
Created August 15, 2018 17:38
Add button to App.js
import React from 'react';
import { StyleSheet, Text, View, Button } from 'react-native';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<Text>Changes you make will automatically reload.</Text>
<Text>Shake your phone to open the developer menu.</Text>
@adrian-afergon
adrian-afergon / App.test.js
Created August 15, 2018 17:28
Adding test for find button inside App
import React from 'react';
import App from './App';
import renderer from 'react-test-renderer';
import Adapter from 'enzyme-adapter-react-16'
import { shallow, configure } from 'enzyme';
configure({ adapter: new Adapter() });
it('renders without crashing', () => {
@adrian-afergon
adrian-afergon / App.test.js
Created July 29, 2018 19:04
Default test for test App.js in React Native
import React from 'react';
import App from './App';
import renderer from 'react-test-renderer';
it('renders without crashing', () => {
const rendered = renderer.create(<App />).toJSON();
expect(rendered).toBeTruthy();
});
@adrian-afergon
adrian-afergon / firestore.rules
Created June 16, 2018 14:04
Firestor rules extends
match /{document=**} {
allow read, write: if (request.auth.uid != null);
}