diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-14 15:08:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-14 15:08:21 +0300 |
commit | 674e7e2c3d295704bdf504dd0caa2e5a2d9b5cd2 (patch) | |
tree | 7454890d4f7aa8644c9e89954a978466e4416815 /spec/frontend/vue_shared/components/code_block_spec.js | |
parent | c7ad2610df033b370845995ac3bbe269a191d9bb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/vue_shared/components/code_block_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/components/code_block_spec.js | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/spec/frontend/vue_shared/components/code_block_spec.js b/spec/frontend/vue_shared/components/code_block_spec.js index 0d21dd94f7c..60b0b0b566b 100644 --- a/spec/frontend/vue_shared/components/code_block_spec.js +++ b/spec/frontend/vue_shared/components/code_block_spec.js @@ -4,10 +4,15 @@ import CodeBlock from '~/vue_shared/components/code_block.vue'; describe('Code Block', () => { let wrapper; - const createComponent = () => { + const defaultProps = { + code: 'test-code', + }; + + const createComponent = (props = {}) => { wrapper = shallowMount(CodeBlock, { propsData: { - code: 'test-code', + ...defaultProps, + ...props, }, }); }; @@ -17,9 +22,23 @@ describe('Code Block', () => { wrapper = null; }); - it('matches snapshot', () => { - createComponent(); + describe('with default props', () => { + beforeEach(() => { + createComponent(); + }); - expect(wrapper.element).toMatchSnapshot(); + it('renders correctly', () => { + expect(wrapper.element).toMatchSnapshot(); + }); + }); + + describe('with maxHeight set to "200px"', () => { + beforeEach(() => { + createComponent({ maxHeight: '200px' }); + }); + + it('renders correctly', () => { + expect(wrapper.element).toMatchSnapshot(); + }); }); }); |