Commit 5d6cb037 authored by Paul Slaughter's avatar Paul Slaughter

Update form_spec to use shallow mount VTU

- This makes testing for disabled/tooltip on
buttons a lot easier
- We were also able to remove a number of
redundant specs
parent c0e171f0
<script> <script>
import { mapState, mapActions, mapGetters } from 'vuex'; import { mapState, mapActions, mapGetters } from 'vuex';
import { GlModal, GlSafeHtmlDirective, GlButton } from '@gitlab/ui'; import { GlModal, GlSafeHtmlDirective, GlButton } from '@gitlab/ui';
import { n__, __ } from '~/locale'; import { n__ } from '~/locale';
import CommitMessageField from './message_field.vue'; import CommitMessageField from './message_field.vue';
import Actions from './actions.vue'; import Actions from './actions.vue';
import SuccessMessage from './success_message.vue'; import SuccessMessage from './success_message.vue';
...@@ -35,10 +35,6 @@ export default { ...@@ -35,10 +35,6 @@ export default {
overviewText() { overviewText() {
return n__('%d changed file', '%d changed files', this.stagedFiles.length); return n__('%d changed file', '%d changed files', this.stagedFiles.length);
}, },
commitButtonText() {
return this.stagedFiles.length ? __('Commit') : __('Stage & Commit');
},
currentViewIsCommitView() { currentViewIsCommitView() {
return this.currentActivityView === leftSidebarViews.commit.name; return this.currentActivityView === leftSidebarViews.commit.name;
}, },
...@@ -160,13 +156,19 @@ export default { ...@@ -160,13 +156,19 @@ export default {
<gl-button <gl-button
:loading="submitCommitLoading" :loading="submitCommitLoading"
class="float-left qa-commit-button" class="float-left qa-commit-button"
data-testid="commit-button"
category="primary" category="primary"
variant="success" variant="success"
@click="commit" @click="commit"
> >
{{ __('Commit') }} {{ __('Commit') }}
</gl-button> </gl-button>
<gl-button v-if="!discardDraftButtonDisabled" class="float-right" @click="discardDraft"> <gl-button
v-if="!discardDraftButtonDisabled"
class="float-right"
data-testid="discard-draft"
@click="discardDraft"
>
{{ __('Discard draft') }} {{ __('Discard draft') }}
</gl-button> </gl-button>
<gl-button <gl-button
......
...@@ -26818,9 +26818,6 @@ msgstr "" ...@@ -26818,9 +26818,6 @@ msgstr ""
msgid "Stage" msgid "Stage"
msgstr "" msgstr ""
msgid "Stage & Commit"
msgstr ""
msgid "Stage data updated" msgid "Stage data updated"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment