diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e5957d78b..664dd0d449 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added compatibility to Gaia/SDK version 0.28.0-rc2 @faboweb - [\#1673](https://github.com/cosmos/voyager/issues/1673) Documentation and single command to run one or all tests with fallback for end to end test @sabau - [\#1683](https://github.com/cosmos/voyager/issues/1683) Governance: block voting twice for the same option @sabau +- [\#1774](https://github.com/cosmos/voyager/issues/1776) added specs for the TmFieldSeed update method and value watcher @coreycosman - [\#1387](https://github.com/cosmos/voyager/issues/1387) Staking: Added list of undelegation transactions @sabau - [\#1661](https://github.com/cosmos/voyager/issues/1661) Boot: multinode available for local-testnet @sabau - [\#1748](https://github.com/cosmos/voyager/issues/1748) display governance parameters on tab @fedekunze diff --git a/test/unit/specs/components/common/TmFieldSeed.spec.js b/test/unit/specs/components/common/TmFieldSeed.spec.js index 782fb2ad04..db81a911ee 100644 --- a/test/unit/specs/components/common/TmFieldSeed.spec.js +++ b/test/unit/specs/components/common/TmFieldSeed.spec.js @@ -25,4 +25,26 @@ describe(`TmFieldSeed`, () => { it(`has the correct class`, () => { expect(wrapper.find(`.tm-field`).classes()).toContain(`tm-field-seed`) }) + + it(`emits input event on update method call`, () => { + wrapper.vm.update(`test event`) + expect(wrapper.emitted().input[0][0]).toEqual(`test event`) + }) + + it(`does not emit input event when update method not called`, () => { + expect(wrapper.emitted()).toEqual({}) + }) + it(`does not call autosize.update when value does not change`, async () => { + const autosize = require(`autosize`) + const spy = jest.spyOn(autosize, `update`) + expect(spy.mock.calls).toEqual([]) + }) + it(`calls autosize.update when value changes`, async () => { + const autosize = require(`autosize`) + const spy = jest.spyOn(autosize, `update`) + wrapper.setProps({ value: `change value` }) + await wrapper.vm.$nextTick() + expect(spy).toBeCalled() + expect(spy.mock.calls[0].length).toEqual(1) + }) })