Skip to content

Instantly share code, notes, and snippets.

View colinfwren's full-sized avatar

Colin Wren colinfwren

View GitHub Profile
import { TextInput, View, StyleSheet } from 'react-native';
import React from 'react';
import PropTypes from 'prop-types';
/**
* Styles to use for Pokemon Picker Input
*/
const styles = StyleSheet.create({
searchView: {
padding: 5,
import React from 'react';
import renderer from 'react-test-renderer';
import Input from '../../../../src/components/inputs/pokemonPicker/Input';
describe('PokemonPickerInput', () => {
it('Renders the component', () => {
const tree = renderer.create(<Input onSearchTextChange={jest.fn()} />)
.toJSON();
expect(tree).toMatchSnapshot();
});
import { Input } from '../../../src/components/inputs/pokemonPicker';
storiesOf('PokemonPicker', module)
.add('Search Input', () => (
<WrapperView>
<Input onSearchTextChange={(text) => console.log(text)}/>
</WrapperView>
));
import React from 'react';
import { Button } from 'react-native';
import { storiesOf } from '@storybook/react-native';
import { State, Store } from "@sambego/storybook-state";
import { Modal, Cell, Row, Input, List } from '../../src/components/inputs/pokemonPicker';
const store = new Store({
visible: false
});
from notion.client import NotionClient
from notion.collection import NotionDate
from datetime import datetime
CYCLE_COVER = 'https://images.unsplash.com/photo-1518623001395-125242310d0c?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb'
CYCLE_URL = '' # URL of the Test Cycle Collection
TOKEN = '' # Auth token taken from Notion's token_v2 cookie
notion = NotionClient(token_v2=TOKEN)
cycle_collection = notion.get_collection_view(CYCLE_URL)
"""
self.test_executions - Test Execution collection
self.cycle_name - Name of the Test Cycle
self.cycle - Create Test Cycle instance
"""
def pytest_runtest_logreport(self, report):
if report.when == 'call':
test_execution = self.test_executions.collection.add_row(
icon='🔫',
"""
self.cycle - Test Cycle Instance
self.test_executions - Test Execution collection
"""
def pytest_terminal_summary(self, terminalreporter, exitstatus, config):
if exitstatus == 0:
self.cycle.execution_status = 'Passed'
if exitstatus == 1:
self.cycle.execution_status = 'Failed'
{
"name": "@ACMEinc/package",
"main": "node_modules/expo/AppEntry.js",
"repository": {
"type": "git",
"url": "ssh://[email protected]/ACMEinc/package.git"
},
"version": "0.0.1",
"scripts": {
"start": "expo start",
@colinfwren
colinfwren / componentWithStylesheet.js
Created September 1, 2019 13:33
Component with Stylesheet
import React from 'react';
import { StyleSheet, View } from 'react-native';
const styles = StyleSheet.create({
foo: {
height: 1,
backgroundColor: '#ff0000',
},
});
@colinfwren
colinfwren / ThemeContextProvider.js
Created September 1, 2019 13:36
Theme Context Provider and withTheme HOC
import React, { useContext } from 'react';
const ThemeContext = React.createContext();
export const ThemeContextProvider = ({ children, theme }) => (
<ThemeContext.Provider value={{ theme }}>
{children}
</ThemeContext.Provider>
);