diff --git a/packages/eui/src/components/code/__snapshots__/code_block.test.tsx.snap b/packages/eui/src/components/code/__snapshots__/code_block.test.tsx.snap index d2637f74d98..b7f00f4ae15 100644 --- a/packages/eui/src/components/code/__snapshots__/code_block.test.tsx.snap +++ b/packages/eui/src/components/code/__snapshots__/code_block.test.tsx.snap @@ -382,59 +382,6 @@ exports[`EuiCodeBlock line numbers renders line numbers with a start value 1`] = `; -exports[`EuiCodeBlock props copyAriaLabel is rendered 1`] = ` -
-
-    
-      
-        var some = 'code';
-
-      
-      
-        console.log(some);
-      
-    
-  
-
-
- - - -
-
-
-`; - exports[`EuiCodeBlock props fontSize l is rendered 1`] = `
{ }); }); - describe('copyAriaLabel', () => { - it('is rendered', () => { - const customLabel = 'Copy this code'; - const { container } = render( - - {code} - - ); + it('renders `copyAriaLabel` on the copy button', () => { + const customLabel = 'Copy this code'; + const { getByTestSubject } = render( + + {code} + + ); - expect(container.firstChild).toMatchSnapshot(); - }); + expect(getByTestSubject('euiCodeBlockCopy')).toHaveAttribute( + 'aria-label', + customLabel + ); }); describe('overflowHeight', () => {