From 8c0a0b64a729dc76b1cf10c17b15ae1d1f6db23d Mon Sep 17 00:00:00 2001 From: ti-aiuto Date: Tue, 18 May 2021 22:33:40 +0900 Subject: [PATCH] =?UTF-8?q?:white=5Fcheck=5Fmark:=20scaleStyle=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/app/pages/timer-page.spec.ts | 16 ++++++++++++++++ src/app/pages/timer-page.vue | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/spec/app/pages/timer-page.spec.ts b/spec/app/pages/timer-page.spec.ts index 551ae61..2c34e1e 100644 --- a/spec/app/pages/timer-page.spec.ts +++ b/spec/app/pages/timer-page.spec.ts @@ -14,4 +14,20 @@ jest.mock('@/app/time-up-audio') describe('TimerPage', () => { testMountComponent(() => factory({ shallow: false })) + + describe('computed', () => { + describe('scaleStyle', () => { + it('style用のオブジェクトを返すこと', () => { + const wrapper = factory() + wrapper.vm.scale = 1 + expect(wrapper.vm.scaleStyle).toEqual({ transform: 'scale(1)' }) + + wrapper.vm.scale = 0.5 + expect(wrapper.vm.scaleStyle).toEqual({ transform: 'scale(0.5)' }) + + wrapper.vm.scale = 2 + expect(wrapper.vm.scaleStyle).toEqual({ transform: 'scale(2)' }) + }) + }) + }) }) diff --git a/src/app/pages/timer-page.vue b/src/app/pages/timer-page.vue index 1fba5c7..00ccfc5 100644 --- a/src/app/pages/timer-page.vue +++ b/src/app/pages/timer-page.vue @@ -8,7 +8,7 @@ @@ -37,7 +37,7 @@ export default class TimerPage extends Vue { this.scale = 1 } - get scaleClass(): object { + get scaleStyle(): object { return { transform: `scale(${this.scale})` } } }