Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple, robust and performant API #597

Closed
wants to merge 28 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

use jest-react-fela for all component snapshot tests

  • Loading branch information...
rofrischmann
rofrischmann committed Sep 26, 2018
commit d8d8bd0fbce7bb13bca7b226fa54624f65ffbeae

This file was deleted.

@@ -6,7 +6,7 @@ import FelaThemeFactory from '../FelaThemeFactory'
import FelaComponentFactory from '../FelaComponentFactory'
import { THEME_CHANNEL } from '../themeChannel'

import createSnapshot from '../__helpers__/createSnapshot'
import createSnapshot from '../../../jest-react-fela/src/createSnapshot'

const FelaTheme = FelaThemeFactory(Component, {
[THEME_CHANNEL]: PropTypes.object,
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types'
import FelaThemeFactory from '../FelaThemeFactory'
import { THEME_CHANNEL } from '../themeChannel'

import createSnapshot from '../__helpers__/createSnapshot'
import createSnapshot from '../../../jest-react-fela/src/createSnapshot'

const FelaTheme = FelaThemeFactory(Component, {
[THEME_CHANNEL]: PropTypes.object,
@@ -6,7 +6,7 @@ import ThemeProviderFactory from '../ThemeProviderFactory'
import FelaThemeFactory from '../FelaThemeFactory'
import { THEME_CHANNEL } from '../themeChannel'

import createSnapshot from '../__helpers__/createSnapshot'
import createSnapshot from '../../../jest-react-fela/src/createSnapshot'

const FelaTheme = FelaThemeFactory(Component, {
[THEME_CHANNEL]: PropTypes.object,
@@ -1,172 +1,167 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Using the FelaComponent component should accept a string primitive type via as-prop 1`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: red
}",
"html": "<span class=\\"a b\\"></span>",
color: red;
}


<span className=a b />;
"
`;

exports[`Using the FelaComponent component should accept an array as style 1`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: red
color: red;
}

.c {
background-color: black
}",
"html": "<div class=\\"a b c\\">I am red on black and written in 12px.</div>",
background-color: black;
}


<div className=a b c>I am red on black and written in 12px.</div>;
"
`;

exports[`Using the FelaComponent component should accept an array as style 2`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: red
color: red;
}

.c {
background-color: blue
}",
"html": "<div class=\\"a b c\\">I am red on blue and written in 12px.</div>",
background-color: blue;
}


<div className=a b c>I am red on blue and written in 12px.</div>;
"
`;

exports[`Using the FelaComponent component should compose extension rules 1`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: red
color: red;
}

.c {
background-color: blue
}",
"html": "<button class=\\"a b c\\">Hello World</button>",
background-color: blue;
}


<button className=a b c>Hello World</button>;
"
`;

exports[`Using the FelaComponent component should compose extension rules 2`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: black
color: black;
}

.c {
background-color: blue
}",
"html": "<button class=\\"a b c\\">Hello World</button>",
background-color: blue;
}


<button className=a b c>Hello World</button>;
"
`;

exports[`Using the FelaComponent component should compose nested extensions 1`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: black
color: black;
}

.c {
border: 1px solid grey
border: 1px solid grey;
}

.d {
padding: 10px
padding: 10px;
}

.e {
background-color: blue
}",
"html": "<button class=\\"a b c d e\\">Hello World</button>",
background-color: blue;
}


<button className=a b c d e>Hello World</button>;
"
`;

exports[`Using the FelaComponent component should correctly pass the theme and other props to functional style 1`] = `
Object {
"css": ".a {
font-size: 15px
".a {
font-size: 15px;
}

.b {
background-color: blue
}",
"html": "<div class=\\"a b\\">I am red and written in 15px.</div>",
background-color: blue;
}


<div className=a b>I am red and written in 15px.</div>;
"
`;

exports[`Using the FelaComponent component should correctly render a fela rule 1`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: red
}",
"html": "<div class=\\"a b\\">I am red and written in 12px.</div>",
color: red;
}


<div className=a b>I am red and written in 12px.</div>;
"
`;

exports[`Using the FelaComponent component should default to a div 1`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: red
}",
"html": "<div class=\\"a b\\"></div>",
color: red;
}


<div className=a b />;
"
`;

exports[`Using the FelaComponent component should render children in default mode 1`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: red
}",
"html": "<div class=\\"a b\\"><span>Hello World</span></div>",
color: red;
}


<div className=a b>
<span>Hello World</span>
</div>;
"
`;

exports[`Using the FelaComponent component should render children using the correct as-prop 1`] = `
Object {
"css": ".a {
font-size: 12px
".a {
font-size: 12px;
}

.b {
color: red
}",
"html": "<h1 class=\\"a b\\">Hello World</h1>",
color: red;
}


<h1 className=a b>Hello World</h1>;
"
`;
@@ -1,8 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Using the FelaTheme component correctly pass the theme down 1`] = `
Object {
"css": "",
"html": "<div>The color is red.</div>",
}
"

<div>The color is red.</div>;
"
`;
@@ -1,8 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Using the ThemeProvider should pass the theme to rule props 1`] = `
Object {
"css": "",
"html": "<div>{\\"color\\":\\"red\\"}</div>",
}
"

<div>
{{}
color:red
{}}
</div>;
"
`;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.