File tree Expand file tree Collapse file tree 4 files changed +11
-16
lines changed Expand file tree Collapse file tree 4 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,6 @@ import { ParallaxProvider } from '../ParallaxProvider';
11
11
import { MockProvider } from '../../testUtils/MockProvider' ;
12
12
import expectRenderError from '../../testUtils/expectRenderError' ;
13
13
14
- const consoleLog = global . console . log ;
15
-
16
14
describe ( 'Expect the <Parallax> component' , ( ) => {
17
15
const preventError = ( e : ErrorEvent ) => e . preventDefault ( ) ;
18
16
@@ -21,11 +19,6 @@ describe('Expect the <Parallax> component', () => {
21
19
} ) ;
22
20
23
21
afterEach ( ( ) => {
24
- global . console . log = consoleLog ;
25
- // NOTE: this can probably be removed now
26
- // @ts -ignore
27
- global . ParallaxController = undefined ;
28
-
29
22
window . removeEventListener ( 'error' , preventError ) ;
30
23
} ) ;
31
24
@@ -34,22 +27,24 @@ describe('Expect the <Parallax> component', () => {
34
27
< ParallaxProvider >
35
28
< Parallax
36
29
className = "class-foo"
30
+ innerClassName = "class-foo"
37
31
disabled = { false }
38
32
translateX = { [ - 100 , 100 ] }
39
33
translateY = { [ '-100%' , '100%' ] }
40
34
style = { {
41
35
border : 'solid red 2px' ,
42
36
} }
43
- styleInner = { {
44
- border : 'solid blue 2px ' ,
37
+ innerStyle = { {
38
+ border : 'solid blue 23px ' ,
45
39
} }
46
40
tag = "figure"
47
- tagInner = "div"
41
+ innerTag = "div"
48
42
>
49
43
< div className = "foo" />
50
44
</ Parallax >
51
45
</ ParallaxProvider >
52
46
) ;
47
+
53
48
expect ( asFragment ( ) ) . toMatchSnapshot ( ) ;
54
49
} ) ;
55
50
Original file line number Diff line number Diff line change @@ -113,14 +113,14 @@ export function Parallax(props: PropsWithChildren<ParallaxProps>) {
113
113
] ) ;
114
114
115
115
const Outer = props . tag ;
116
- const Inner = props . tagInner ;
116
+ const Inner = props . innerTag ;
117
117
118
118
return (
119
119
< Outer className = { props . className } ref = { refOuter } style = { props . style } >
120
120
< Inner
121
121
className = { props . innerClassName }
122
122
ref = { refInner }
123
- style = { props . styleInner }
123
+ style = { props . innerStyle }
124
124
>
125
125
{ props . children }
126
126
</ Inner >
@@ -130,6 +130,6 @@ export function Parallax(props: PropsWithChildren<ParallaxProps>) {
130
130
131
131
Parallax . defaultProps = {
132
132
disabled : false ,
133
- tagInner : 'div' ,
133
+ innerTag : 'div' ,
134
134
tag : 'div' ,
135
135
} ;
Original file line number Diff line number Diff line change @@ -21,15 +21,15 @@ export interface ParallaxProps extends ParallaxElementConfig {
21
21
/**
22
22
* Style object to be added to the innermost parallax element.
23
23
*/
24
- styleInner ?: any ;
24
+ innerStyle ?: any ;
25
25
/**
26
26
* Style object to be added to the outermost parallax element.
27
27
*/
28
28
style ?: any ;
29
29
/**
30
30
* HTML element tag name to be applied to the innermost parallax element.
31
31
*/
32
- tagInner ?: any ;
32
+ innerTag ?: any ;
33
33
/**
34
34
* HTML element tag name to be applied to the outermost parallax element.
35
35
*/
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export const ParallaxBanner = ({
73
73
< Parallax
74
74
key = { `layer-${ i } ` }
75
75
speed = { speed }
76
- styleInner = { absoluteStyle }
76
+ innerStyle = { absoluteStyle }
77
77
style = { absoluteStyle }
78
78
disabled = { disabled }
79
79
>
You can’t perform that action at this time.
0 commit comments