Skip to content

Commit 7e461c5

Browse files
committed
chore: restore legacy selectors
1 parent 9b66511 commit 7e461c5

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

src/__tests__/snapshot-tests/__snapshots__/test-utils-selectors.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ exports[`test-utils selectors 1`] = `
386386
"awsui_direction-button-inline-start_8k1rt",
387387
"awsui_direction-button-visible_8k1rt",
388388
"awsui_disabled_15o6u",
389+
"awsui_dropdown_qwoo0",
389390
"awsui_expand-toggle_1xe88",
390391
"awsui_filter-container_z5mul",
391392
"awsui_filtering-match-highlight_1p2cx",
@@ -416,6 +417,7 @@ exports[`test-utils selectors 1`] = `
416417
"awsui_root_1om0h",
417418
"awsui_root_1qprf",
418419
"awsui_root_1t44z",
420+
"awsui_root_qwoo0",
419421
"awsui_root_vrgzu",
420422
"awsui_screenreader-content_15o6u",
421423
"awsui_secondary_x6dl3",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
.root {
7+
/* used in test-utils */
8+
}
9+
10+
.dropdown {
11+
/* used in test-utils */
12+
}

src/test-utils/dom/dropdown/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
import { ComponentWrapper, createWrapper, ElementWrapper } from '@cloudscape-design/test-utils-core/dom';
44

55
import styles from '../../../dropdown/styles.selectors.js';
6-
import testutilStyles from '../../../dropdown/test-classes/styles.selectors.js';
6+
import testUtilStyles from '../../../dropdown/test-classes/styles.selectors.js';
7+
import legacyStyles from '../../../internal/components/dropdown/styles.selectors.js';
78

89
export class DropdownContentWrapper extends ComponentWrapper {
10+
static legacyRootSelector: string = legacyStyles.root;
11+
static legacyDropdownSelector: string = legacyStyles.dropdown;
12+
913
/**
1014
* Returns the dropdown content.
1115
*/
@@ -17,14 +21,14 @@ export class DropdownContentWrapper extends ComponentWrapper {
1721
* Returns the dropdown header.
1822
*/
1923
findHeader(): ElementWrapper | null {
20-
return this.findByClassName(testutilStyles.header);
24+
return this.findByClassName(testUtilStyles.header);
2125
}
2226

2327
/**
2428
* Returns the dropdown footer.
2529
*/
2630
findFooter(): ElementWrapper | null {
27-
return this.findByClassName(testutilStyles.footer);
31+
return this.findByClassName(testUtilStyles.footer);
2832
}
2933
}
3034

@@ -35,7 +39,7 @@ export default class DropdownWrapper extends ComponentWrapper {
3539
* Returns the trigger element.
3640
*/
3741
findTrigger(): ElementWrapper {
38-
return this.findByClassName(testutilStyles.trigger)!;
42+
return this.findByClassName(testUtilStyles.trigger)!;
3943
}
4044

4145
/**

0 commit comments

Comments
 (0)