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})` } } }