diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d202b08001..84e1b7832e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Normalized button `moz-focus-inner` ([#2445](https://github.com/elastic/eui/pull/2445)) - Fixed typo to correct `aria-modal` attribute in`EuiPopover` ([#2488](https://github.com/elastic/eui/pull/2488)) +- Fixed position of `EuiCodeBlock` controls and added more tests ([#2459](https://github.com/elastic/eui/pull/2459)) ## [`14.8.0`](https://github.com/elastic/eui/tree/v14.8.0) diff --git a/src/components/code/__snapshots__/code_block.test.js.snap b/src/components/code/__snapshots__/code_block.test.js.snap index 93accaa3b7c..f4085c6c5dd 100644 --- a/src/components/code/__snapshots__/code_block.test.js.snap +++ b/src/components/code/__snapshots__/code_block.test.js.snap @@ -1,5 +1,239 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`EuiCodeBlock props fontSize l is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+`; + +exports[`EuiCodeBlock props fontSize m is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+`; + +exports[`EuiCodeBlock props fontSize s is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+`; + +exports[`EuiCodeBlock props isCopyable is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+
+ + + +
+
+
+`; + +exports[`EuiCodeBlock props language is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+`; + +exports[`EuiCodeBlock props overflowHeight is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+ +
+
+`; + +exports[`EuiCodeBlock props paddingSize l is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+`; + +exports[`EuiCodeBlock props paddingSize m is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+`; + +exports[`EuiCodeBlock props paddingSize none is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+`; + +exports[`EuiCodeBlock props paddingSize s is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+`; + +exports[`EuiCodeBlock props transparentBackground is rendered 1`] = ` +
+
+    
+      var some = 'code';
+console.log(some);
+    
+  
+
+`; + exports[`EuiCodeBlock renders a code block 1`] = `
{ expect(component).toMatchSnapshot(); }); + + describe('props', () => { + describe('transparentBackground', () => { + it('is rendered', () => { + const component = render( + {code} + ); + + expect(component).toMatchSnapshot(); + }); + }); + + describe('isCopyable', () => { + it('is rendered', () => { + const component = render( + {code} + ); + + expect(component).toMatchSnapshot(); + }); + }); + + describe('overflowHeight', () => { + it('is rendered', () => { + const component = render( + {code} + ); + + expect(component).toMatchSnapshot(); + }); + }); + + describe('language', () => { + it('is rendered', () => { + const component = render( + {code} + ); + + expect(component).toMatchSnapshot(); + }); + }); + + describe('fontSize', () => { + FONT_SIZES.forEach(fontSize => { + test(`${fontSize} is rendered`, () => { + const component = render( + {code} + ); + + expect(component).toMatchSnapshot(); + }); + }); + }); + + describe('paddingSize', () => { + PADDING_SIZES.forEach(paddingSize => { + test(`${paddingSize} is rendered`, () => { + const component = render( + {code} + ); + + expect(component).toMatchSnapshot(); + }); + }); + }); + }); });