Skip to content

Commit 717ddcb

Browse files
author
Eric Olkowski
committed
Fixed failing tests
1 parent 6b76848 commit 717ddcb

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

packages/react-core/src/components/Alert/Alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ export const Alert: React.FunctionComponent<AlertProps> = ({
161161
}, [shouldDismiss, hasAnimations, isDismissed]);
162162

163163
React.useEffect(() => {
164-
const prefersReducedMotion = !window.matchMedia('(prefers-reduced-motion: no-preference)')?.matches;
165164
const handleOnTransitionEnd = (event: TransitionEvent) => {
165+
const prefersReducedMotion = !window.matchMedia('(prefers-reduced-motion: no-preference)')?.matches;
166166
const parentAlertGroupItem = getParentAlertGroupItem();
167167
if (
168168
parentAlertGroupItem?.contains(event.target as Node) &&

packages/react-core/src/components/Alert/AlertActionCloseButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export const AlertActionCloseButton: React.FunctionComponent<AlertActionCloseBut
4242
};
4343

4444
React.useEffect(() => {
45-
const prefersReducedMotion = !window.matchMedia('(prefers-reduced-motion: no-preference)')?.matches;
4645
const handleOnTransitionEnd = (event: TransitionEvent) => {
46+
const prefersReducedMotion = !window.matchMedia('(prefers-reduced-motion: no-preference)')?.matches;
4747
const parentAlertGroupItem = getParentAlertGroupItem();
4848
if (
4949
shouldDismissOnTransition &&

packages/react-core/src/components/Alert/__tests__/AlertGroup.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ test('alertgroup closes when alerts are closed', async () => {
7171
const user = userEvent.setup();
7272

7373
render(
74-
<AlertGroup isToast appendTo={document.body}>
74+
<AlertGroup hasAnimations={false} isToast appendTo={document.body}>
7575
<Alert
7676
isLiveRegion
7777
title={'Test Alert'}

packages/react-integration/demo-app-ts/src/components/demos/AlertGroupDemo/AlertGroupDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class AlertGroupDemo extends Component<{}, AlertGroupDemoState> {
7373
</Button>
7474
</InputGroupItem>
7575
</InputGroup>
76-
<AlertGroup isToast>
76+
<AlertGroup hasAnimations={false} isToast>
7777
{this.state.alerts.map(({ title, variant, key }) => (
7878
<Alert
7979
isLiveRegion

packages/react-integration/demo-app-ts/src/components/demos/AlertGroupDemo/AlertGroupTimeoutFromBottomDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const AlertGroupTimeoutFromBottomDemo: React.FunctionComponent = () => {
3737
<Button variant="secondary" onClick={onClick}>
3838
Add alert
3939
</Button>
40-
<AlertGroup>{alerts}</AlertGroup>
40+
<AlertGroup hasAnimations={false}>{alerts}</AlertGroup>
4141
</>
4242
);
4343
};

0 commit comments

Comments
 (0)