Skip to content

Commit 9a328c7

Browse files
committed
Move small set test-stories off of React
1 parent 8dab906 commit 9a328c7

File tree

6 files changed

+5
-174
lines changed

6 files changed

+5
-174
lines changed

test-stories/a.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

test-stories/aWrap.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

test-stories/b.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

test-stories/star.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

test-stories/tests.stories.js

Lines changed: 5 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
/* eslint-env browser */
22

3-
import React from 'react';
4-
53
import isChromatic from '../isChromatic';
6-
import AComponent from './a';
74

85
export default {
96
title: 'Tests',
@@ -12,66 +9,23 @@ export default {
129

1310
export const WithViewports = {
1411
render: () => {
15-
let bg;
1612
if (window.matchMedia('(max-width: 400px)').matches) {
17-
bg = 'cyan';
13+
return 'A';
1814
} else if (window.matchMedia('(max-width: 800px)').matches) {
19-
bg = 'orange';
15+
return 'B';
2016
}
21-
return (
22-
<AComponent backgroundColor={bg} thing={() => {}}>
23-
Contents
24-
</AComponent>
25-
);
17+
return 'C';
2618
},
2719

2820
parameters: { chromatic: { viewports: [320, 600, 1200] } },
2921
};
3022

3123
export const WithDelay = {
32-
render: () => <AComponent thing={() => {}}>{isChromatic() ? 'Chromatic' : 'Second'}</AComponent>,
33-
24+
render: () => (isChromatic() ? 'Chromatic' : 'Second'),
3425
parameters: { chromatic: { delay: 1000 } },
3526
};
3627

3728
export const DisabledStory = {
38-
render: () => <AComponent thing={() => {}}>Disabled story</AComponent>,
29+
render: () => 'Disabled story',
3930
parameters: { chromatic: { disable: true } },
4031
};
41-
42-
export const IgnoredElements = () => (
43-
<div>
44-
<img
45-
alt=""
46-
src="http://fpoimg.com/100x100?text=foozbar"
47-
data-chromatic="ignore"
48-
style={{ border: '2px solid orangered' }}
49-
/>
50-
<img
51-
alt=""
52-
src="http://fpoimg.com/100x100?text=foozbar"
53-
className="chromatic-ignore"
54-
style={{ border: '2px solid orangered' }}
55-
/>
56-
<img
57-
alt=""
58-
src="http://fpoimg.com/100x100?text=foozbar"
59-
style={{ border: '2px solid green' }}
60-
/>
61-
</div>
62-
);
63-
64-
export const RightToLeftBody = () => {
65-
React.useEffect(() => {
66-
const { dir } = document.body;
67-
document.body.dir = 'rtl';
68-
return () => {
69-
document.body.dir = dir;
70-
};
71-
}, []);
72-
return <div>Content</div>;
73-
};
74-
75-
export const RightToLeftContainer = () => {
76-
return <div dir="rtl">Content</div>;
77-
};

test-stories/timing.stories-disabled.js

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)