Skip to content

Instantly share code, notes, and snippets.

View rickyalmeidadev's full-sized avatar
👨‍💻
Learning something new everyday

Ricky Almeida rickyalmeidadev

👨‍💻
Learning something new everyday
View GitHub Profile
@goodpic
goodpic / HookTest.spec.ts
Created September 12, 2019 17:12
Test React Hooks with react-native-testing-library
import * as React from 'react'
import { fireEvent, render } from 'react-native-testing-library'
import { HookTest } from '../HookTest'
describe('Test Hooks', () => {
test('changeText', () => {
const { getByTestId, getByPlaceholder, queryByDisplayValue } = render(
<HookTest />)
@nickhudkins
nickhudkins / createFragmentContainer.js
Last active July 30, 2021 16:18
Data Masking with Apollo / GraphQL Anywhere
import React from 'react';
import { filter } from 'graphql-anywhere';
import hoistNonReactStatic from 'hoist-non-react-statics';
/*
* createFragmentContainer returns a component which expects props that match
* WrappedComponent's fragment names, and provides data masking
*/
export default function createFragmentContainer(WrappedComponent) {