Skip to content

Commit b7ffeda

Browse files
committed
fix: header-variant test
1 parent b3a90d4 commit b7ffeda

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/app-layout/__tests__/header-variant.test.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33
import React from 'react';
4+
import { waitFor } from '@testing-library/react';
45

56
import { findUpUntil } from '@cloudscape-design/component-toolkit/dom';
67

@@ -31,11 +32,13 @@ describeEachAppLayout({ themes: ['refresh', 'refresh-toolbar'], sizes: ['desktop
3132
}
3233
});
3334

34-
test('high-contrast', () => {
35+
test('high-contrast', async () => {
3536
const { wrapper } = renderComponent(
3637
<AppLayout notifications="Notifications" breadcrumbs="Breadcrumbs" headerVariant="high-contrast" />
3738
);
38-
expect(hasHighContrastContext(wrapper.findNotifications()!.getElement())).toBeTruthy();
39+
await waitFor(() => {
40+
expect(hasHighContrastContext(wrapper.findNotifications()!.getElement())).toBeTruthy();
41+
});
3942
if (theme === 'refresh') {
4043
// For refresh toolbar, high-contrast header is not implemented in contentHeader slot, or in conjunction with ContentLayout
4144
expect(hasHighContrastContext(wrapper.findBreadcrumbs()!.getElement())).toBeTruthy();

0 commit comments

Comments
 (0)