diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/frontend/design_management/components/design_scaler_spec.js | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/frontend/design_management/components/design_scaler_spec.js')
-rw-r--r-- | spec/frontend/design_management/components/design_scaler_spec.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/frontend/design_management/components/design_scaler_spec.js b/spec/frontend/design_management/components/design_scaler_spec.js index 8a123b2d1e5..095c070e5e8 100644 --- a/spec/frontend/design_management/components/design_scaler_spec.js +++ b/spec/frontend/design_management/components/design_scaler_spec.js @@ -13,7 +13,11 @@ describe('Design management design scaler component', () => { const setScale = (scale) => wrapper.vm.setScale(scale); const createComponent = () => { - wrapper = shallowMount(DesignScaler); + wrapper = shallowMount(DesignScaler, { + propsData: { + maxScale: 2, + }, + }); }; beforeEach(() => { @@ -61,6 +65,18 @@ describe('Design management design scaler component', () => { expect(wrapper.emitted('scale')).toEqual([[1.2]]); }); + it('computes & increments correct stepSize based on maxScale', async () => { + wrapper.setProps({ maxScale: 11 }); + + await wrapper.vm.$nextTick(); + + getIncreaseScaleButton().vm.$emit('click'); + + await wrapper.vm.$nextTick(); + + expect(wrapper.emitted().scale[0][0]).toBe(3); + }); + describe('when `scale` value is 1', () => { it('disables the "reset" button', () => { const resetButton = getResetScaleButton(); @@ -77,7 +93,7 @@ describe('Design management design scaler component', () => { }); }); - describe('when `scale` value is 2 (maximum)', () => { + describe('when `scale` value is maximum', () => { beforeEach(async () => { setScale(2); await wrapper.vm.$nextTick(); |