diff --git a/components/app/__tests__/index.test.tsx b/components/app/__tests__/index.test.tsx index 6000db19a2..cd785522ca 100644 --- a/components/app/__tests__/index.test.tsx +++ b/components/app/__tests__/index.test.tsx @@ -202,10 +202,12 @@ describe('App', () => { expect(container.querySelector('.anticon')).toBeTruthy(); const dynamicStyles = Array.from(document.querySelectorAll('style[data-css-hash]')); + // Self-contained .anticon style + const regex = /(?:^|\})\s*\.anticon\s*{[^}]*}/; expect( dynamicStyles.some((style) => { const { innerHTML } = style; - return innerHTML.startsWith('.anticon'); + return regex.test(innerHTML); }), ).toBeTruthy(); });