Skip to content

Commit ac54d96

Browse files
committed
fix: ts error and update tests
1 parent c048f80 commit ac54d96

File tree

3 files changed

+5
-32
lines changed

3 files changed

+5
-32
lines changed

src/components/Parallax/__snapshots__/index.test.tsx.snap

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`given the <Parallax> component given the <Parallax> component when given children then it renders them 1`] = `
4-
<DocumentFragment>
5-
<div
6-
style="will-change: transform;"
7-
>
8-
<div
9-
class="foo"
10-
/>
11-
</div>
12-
</DocumentFragment>
13-
`;
14-
15-
exports[`given the <Parallax> component given the <Parallax> component when normal configurations are given then it renders correctly 1`] = `
16-
<DocumentFragment>
17-
<div
18-
class="class-foo"
19-
style="border: 2px solid red; will-change: transform; transform: translateX(100%)translateY(100%);"
20-
>
21-
<div
22-
class="foo"
23-
/>
24-
</div>
25-
</DocumentFragment>
26-
`;
27-
283
exports[`given the <Parallax> component when normal configurations are given then it renders correctly 1`] = `
294
<DocumentFragment>
305
<div

src/components/Parallax/index.test.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,14 @@ describe('given the <Parallax> component', () => {
6666
id="test-id"
6767
data-testid="data-test-id"
6868
data-foo="bar"
69-
aria-role="button"
69+
aria-label="Cool"
7070
/>
7171
</ParallaxProvider>
7272
);
7373
expect(getByTestId('data-test-id')).toBeInTheDocument();
7474
expect(container.querySelector('.my-class')).toBeInTheDocument();
7575
expect(container.querySelector('#test-id')).toBeInTheDocument();
76-
expect(getByTestId('data-test-id')).toHaveAttribute(
77-
'aria-role',
78-
'button'
79-
);
76+
expect(getByTestId('data-test-id')).toHaveAttribute('aria-label', 'Cool');
8077
expect(getByTestId('data-test-id')).toHaveAttribute('data-foo', 'bar');
8178
expect(getByTestId('data-test-id').style.background).toBe('red');
8279
});

src/components/ParallaxBanner/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import React, { PropsWithChildren } from 'react';
2+
import { CSSProperties } from 'react';
23
import { Parallax } from '../Parallax';
34
import { ParallaxBannerProps } from './types';
45

5-
const containerStyle = {
6+
const containerStyle: CSSProperties = {
67
position: 'relative',
78
overflow: 'hidden',
89
width: '100%',
910
height: '50vh',
1011
};
1112

12-
const absoluteStyle = {
13+
const absoluteStyle: CSSProperties = {
1314
position: 'absolute',
1415
top: 0,
1516
right: 0,

0 commit comments

Comments
 (0)