import { css, StyleSheet } from 'aphrodite';
import * as React from 'react';
import { aphroditeSerializer } from '.';
import { checkSnapshotForEachMethod} from './testUtil';
expect.addSnapshotSerializer(aphroditeSerializer);
const Wrapper: React.SFC = props => {
const styles = StyleSheet.create({
wrapper: {
background: 'papayawhip',
padding: '4em',
},
});
return ;
};
const Title: React.SFC = props => {
const styles = StyleSheet.create({
title: {
color: 'palevioletred',
fontSize: '1.5em',
textAlign: 'center',
},
});
return
;
};
test('Wrapper', () => {
checkSnapshotForEachMethod(
Hello World, this is my first component styled with aphrodite!
);
});
test('when the root element does not have styles', () => {
checkSnapshotForEachMethod(
);
});
test(`doesn't fail for nodes without styles`, () => {
checkSnapshotForEachMethod();
});
test('joins multiple classes', () => {
const styles = StyleSheet.create({
first: { color: 'red' },
second: { backgroundColor: 'black' },
third: { color: 'blue' },
});
checkSnapshotForEachMethod();
});
test('supports mediaQueries', () => {
const styles = StyleSheet.create({
root: {
color: 'red',
'@media(min-width: 200px)': {
color: 'black',
},
},
});
checkSnapshotForEachMethod();
});
test('supports pseudo selectors', () => {
const styles = StyleSheet.create({
root: {
color: 'red',
':hover': {
color: 'green',
},
'@media(min-width: 200px)': {
':hover': {
color: 'black',
},
},
},
});
checkSnapshotForEachMethod();
});