Skip to content

Commit a2d1fa4

Browse files
committed
Add test ID for modal background and content. Switch test to use testid instead of CSS Module classname.
1 parent 177bf55 commit a2d1fa4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/packages/admin-ui-components/src/modal/component.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,16 @@ export const Modal = ({
6969
return (
7070
<>
7171
{isOpen && (
72-
<div ref={overlayRef} className={clsx(overlay ? styles.overlay : styles.noOverlay)}>
72+
<div
73+
ref={overlayRef}
74+
className={clsx(overlay ? styles.overlay : styles.noOverlay)}
75+
data-testid="modal-background"
76+
>
7377
<div
7478
ref={modalRef}
7579
className={clsx(className || [styles.wrapper, fullScreen && styles.fullScreen])}
7680
>
77-
<div className={styles.content}>
81+
<div className={styles.content} data-testid="modal-content">
7882
{title && (
7983
<div className={styles.headerWrapper}>
8084
<div className={styles.header}>

src/packages/end-to-end/src/__tests__/ui/rest/basic-functionality.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('Ensure vehicles can be listed and that they have pilots', async ({ page })
2424
await expect(page.getByTestId('detail-panel-field-pilots')).toContainText(
2525
'pilots*Luke SkywalkerWedge Antilles'
2626
);
27-
await page.locator('._overlay_1slpl_1').click();
27+
await page.getByTestId('modal-background').click();
2828
await page.getByRole('cell', { name: 'AT-ST' }).click();
2929
await expect(page.getByTestId('detail-panel-field-pilots')).toContainText('pilots*Chewbacca');
3030
});

0 commit comments

Comments
 (0)