Skip to content

Instantly share code, notes, and snippets.

View Karniej's full-sized avatar
🏠
Working from home

Paweł Karniej Karniej

🏠
Working from home
View GitHub Profile
class PhotoCard extends React.Component {
constructor(props) {
super(props)
this.state = {
liked: false
}
this.lastPress = 0
render() {
const { liked } = this.state
return (
<TouchableOpacity
activeOpacity={1}
style={styles.card}
onPress={this.handleOnPress}
>
<AnimatedIcon
import { StyleSheet } from 'react-native'
const colors = {
transparent: 'transparent',
white: '#fff',
heartColor: '#e92f3c',
textPrimary: '#515151',
black: '#000',
}
import React from 'react'
import { View, Text, Image, TouchableOpacity, StyleSheet } from 'react-native'
import * as Animatable from 'react-native-animatable'
import Icon from 'react-native-vector-icons/AntDesign'
const colors = {
transparent: 'transparent',
white: '#fff',
heartColor: '#e92f3c',
textPrimary: '#515151',
@Karniej
Karniej / secondTest.spec.js
Created October 1, 2018 19:28
Detox - React Native E2E Testing
describe('Login credentials', () => {
it('Should write the Login in the text Input', async () => {
await expect(element(by.text('Log In'))).toBeVisible()
await element(by.id('Login')).clearText()
await element(by.id('Login')).typeText('Admin')
})
it('Should write the Password in the text Input', async () => {
await element(by.id('Password')).clearText()
@Karniej
Karniej / firstTest.spec.js
Created October 1, 2018 19:26
Detox - React Native E2E Testing
describe('Go through the app', () => {
it('should Go to the Second Screen ', async () => {
await expect(element(by.text('Log In'))).toBeVisible()
await element(by.text('Log In')).tap()
await expect(element(by.text('Second Screen'))).toBeVisible()
await element(by.text('Second Screen')).tap()
})
it('should tap on a filter', async () => {
import React from 'react';
import { View, Text, Picker, Platform } from 'react-native';
const styles = {
wrapper: {
justifyContent: 'center', alignItems: 'center', flex: 1
},
title: {
fontSize: 20,
marginBottom: 40
import React from 'react';
import { View, Text, Picker, Platform } from 'react-native';
class MyPicker extends React.Component {
state = {
system: ''
};
render() {
return (
import 'react-native';
import React from 'react';
import NameScreen from '../NameScreen';
import configureStore from 'redux-mock-store';
import { shallow, configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });
describe('LoginScreen', () => {
beforeEach(async () => {
try {
await device.reloadReactNative();
} catch (error) {}
});
it('should login ', async () => {
await waitFor(element(by.id('logIn')))
.toBeVisible()