Skip to content

Commit

Permalink
各methodsのテストも追加
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-aiuto committed May 18, 2021
1 parent 8c0a0b6 commit 228fc58
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions spec/app/pages/timer-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,37 @@ describe('TimerPage', () => {
})
})
})

describe('methods', () => {
describe('plusScaleButton', () => {
it('scaleの値が変わること', () => {
const wrapper = factory()
wrapper.vm.scale = 1
wrapper.vm.plusScaleButton()
expect(wrapper.vm.scale).toBe(1 + 0.1)
})
})

describe('minusScaleButton', () => {
it('scaleの値が変わること', () => {
const wrapper = factory()
wrapper.vm.scale = 0.6
wrapper.vm.minusScaleButton()
expect(wrapper.vm.scale).toBe(0.6 - 0.1)

wrapper.vm.scale = 0.5
wrapper.vm.minusScaleButton()
expect(wrapper.vm.scale).toBe(0.5)
})
})

describe('resetScaleButton', () => {
it('scaleの値が変わること', () => {
const wrapper = factory()
wrapper.vm.scale = 2.5
wrapper.vm.resetScaleButton()
expect(wrapper.vm.scale).toBe(1)
})
})
})
})

0 comments on commit 228fc58

Please sign in to comment.