Skip to content

Commit b1b69a9

Browse files
committed
Try to make snapshots less brittle
1 parent d028881 commit b1b69a9

File tree

2 files changed

+319
-396
lines changed

2 files changed

+319
-396
lines changed

test/tailwind/feedback/CardModal.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('<CardModal />', () => {
6868
])('renders expected size', (size) => {
6969
const { container } = setUp({ size });
7070
// We need to match against the container's parent (the body) since dialogs are rendered there via portals
71-
expect(container.parentNode).toMatchSnapshot();
71+
expect(container.parentNode?.querySelector('dialog')).toMatchSnapshot();
7272
});
7373

7474
it.each([
@@ -78,7 +78,7 @@ describe('<CardModal />', () => {
7878
])('renders expected variant', (props) => {
7979
const { container } = setUp(props);
8080
// We need to match against the container's parent (the body) since dialogs are rendered there via portals
81-
expect(container.parentNode).toMatchSnapshot();
81+
expect(container.parentNode?.querySelector('dialog')).toMatchSnapshot();
8282
});
8383

8484
it('defers closing the modal until the transition has finished', async () => {

0 commit comments

Comments
 (0)