From a4ecb745e7c5729357066f28fa365c6c21264033 Mon Sep 17 00:00:00 2001 From: Tomer Epstein <57438361+tomer-epstein@users.noreply.github.com> Date: Wed, 18 Nov 2020 15:08:01 +0200 Subject: [PATCH] feat: on 1st generator prompt change 'back' to 'start over' (#418) --- backend/package.json | 39 +++++++++++++++++++------------------- frontend/src/App.vue | 10 +++++++++- frontend/tests/App.spec.js | 18 +++++++++++++++++- 3 files changed, 45 insertions(+), 22 deletions(-) diff --git a/backend/package.json b/backend/package.json index 3439a19c0..5703b3330 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "yeoman-ui", - "version": "1.1.37", + "version": "1.1.38", "displayName": "Application Wizard", "publisher": "SAPOS", "author": { @@ -203,25 +203,24 @@ "webpack-cli": "3.3.12", "lcov-result-merger": "3.1.0", "coveralls": "2.11.16", - "cz-conventional-changelog": "3.3.0", - "@commitlint/cli": "11.0.0", - "@commitlint/config-conventional": "11.0.0", - "husky": "4.3.0" + "cz-conventional-changelog": "3.3.0", + "@commitlint/cli": "11.0.0", + "@commitlint/config-conventional": "11.0.0", + "husky": "4.3.0" }, "husky": { - "hooks": { - "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" - } - }, - "config": { - "commitizen": { - "path": "cz-conventional-changelog" - } - }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - } + "hooks": { + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + } + }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + } } - diff --git a/frontend/src/App.vue b/frontend/src/App.vue index eb015891a..5f73ba92d 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -71,7 +71,7 @@ v-show="promptIndex > 0" style="min-width: 90px" > - mdi-chevron-leftBack + mdi-chevron-left{{ backButtonText }} 0 && @@ -200,6 +206,8 @@ export default { this.isWriting ) { return "Finish"; + } else if (this.promptIndex === 0) { + return "Start"; } return "Next"; diff --git a/frontend/tests/App.spec.js b/frontend/tests/App.spec.js index 2db61b60d..f8c15dd22 100644 --- a/frontend/tests/App.spec.js +++ b/frontend/tests/App.spec.js @@ -31,12 +31,28 @@ describe('App.vue', () => { }) }) + describe('backButtonText - computed', () => { + it('promptIndex is 1', () => { + wrapper = initComponent(App, {}) + wrapper.vm.promptsInfoToDisplay = [{}, {}, {}] + wrapper.vm.promptIndex = 1 + expect(wrapper.vm.backButtonText).toEqual("Start Over"); + }) + + it('promptIndex is 3', () => { + wrapper = initComponent(App, {}) + wrapper.vm.promptsInfoToDisplay = [{}, {}, {}] + wrapper.vm.promptIndex = 3 + expect(wrapper.vm.backButtonText).toEqual("Back"); + }) + }) + describe('nextButtonText - computed', () => { it('promptIndex is 0', () => { wrapper = initComponent(App, {}) wrapper.vm.promptsInfoToDisplay = [{}, {}, {}] wrapper.vm.promptIndex = 0 - expect(wrapper.vm.nextButtonText).toEqual("Next"); + expect(wrapper.vm.nextButtonText).toEqual("Start"); }) it('promptIndex is 1', () => {