Skip to content

Commit fc5cf2f

Browse files
committed
fix test based of coderabbitai comment
1 parent ecbb0be commit fc5cf2f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/react-core/src/components/Accordion/__tests__/Accordion.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,13 @@ test(`Renders without class ${styles.modifiers.noPlain} when isPlain=false and g
143143

144144
test(`Renders with class ${styles.modifiers.noPlain} when isPlain=false and glass theme is applied`, () => {
145145
document.documentElement.classList.add('pf-v6-theme-glass');
146-
render(<Accordion isPlain={false}>Test</Accordion>);
146+
try {
147+
render(<Accordion isPlain={false}>Test</Accordion>);
147148

148-
expect(screen.getByText('Test')).toHaveClass(styles.modifiers.noPlain);
149-
document.documentElement.classList.remove('pf-v6-theme-glass');
149+
expect(screen.getByText('Test')).toHaveClass(styles.modifiers.noPlain);
150+
} finally {
151+
document.documentElement.classList.remove('pf-v6-theme-glass');
152+
}
150153
});
151154

152155
test(`Renders without class ${styles.modifiers.noPlain} when isPlain=true`, () => {

0 commit comments

Comments
 (0)