Skip to content

Instantly share code, notes, and snippets.

View rodoabad's full-sized avatar
😝
Changing the world through JavaScript (and TypeScript)!

Rodo Abad rodoabad

😝
Changing the world through JavaScript (and TypeScript)!
View GitHub Profile
import {CommentList} from '../CommentList';
import React from 'react';
import {shallow} from 'enzyme';
describe('Given the <CommentList/> component', () => {
const requiredProps = () => ({});
const render = (props = requiredProps()) => shallow(<CommentList {...props} />);
test('should render', () => {
import * as React from 'react';
import {MyComponent} from './MyComponent';
import {consumingComponent} from './ConsumingComponent.scss';
const ConsumingComponent = () => (
<MyComponent
HeaderProps={{
color: 'red'
data-testid='consuming-component-header'
type: 'compact'
import * as React from 'react';
import {Greeting, greetingProps} from './Greeting';
import {Header, headerProps} from './Header';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = (props) => {
const {
HeaderProps,
import * as React from 'react';
import {Greeting} from './Greeting';
import {Header} from './Header';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = (props) => {
const {
className,
import * as React from 'react';
import {Greeting} from './Greeting';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = ({className, color, greeting, ...otherProps}) => (
<section
{...otherProps}
className={classnames(className, myComponent)}
import * as React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = ({className, greeting, ...otherProps}) => (
<section
{...otherProps}
className={classnames(className, myComponent)}
>
import * as React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = ({className, greeting}) => (
<section className={classnames(className, myComponent)}>
{greeting}
</section>
);
import * as React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {myComponent} from './MyComponent.scss';
export const MyComponent = (props) => (
<section className={classnames(props.className, myComponent)}>
Hello world.
</section>
);
import * as React from 'react';
import {myComponent} from './MyComponent.scss';
export const MyComponent = () => (
<section className={myComponent}>
Hello world.
</section>
);
import React from 'react';
import {UserGreetingConnector as UserGreeting} from './user-greeting-connector';
export const UserDashboard = () => (
<UserGreeting/>
);