Commit 341081eb authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '250664-test-cases-follow-up' into 'master'

Use namespaced strings & shallowMount

Closes #250664

See merge request gitlab-org/gitlab!42802
parents 390137f2 940f8d4b
<script> <script>
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale'; import { s__ } from '~/locale';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { redirectTo } from '~/lib/utils/url_utility'; import { redirectTo } from '~/lib/utils/url_utility';
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
}) })
.catch(error => { .catch(error => {
createFlash({ createFlash({
message: __('Something went wrong while creating a test case.'), message: s__('TestCases|Something went wrong while creating a test case.'),
captureError: true, captureError: true,
error, error,
}); });
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
:labels-manage-path="labelsManagePath" :labels-manage-path="labelsManagePath"
> >
<template #title> <template #title>
<h3 class="page-title">{{ __('New Test Case') }}</h3> <h3 class="page-title">{{ s__('TestCases|New Test Case') }}</h3>
</template> </template>
<template #actions="issuableMeta"> <template #actions="issuableMeta">
<div class="gl-flex-grow-1"> <div class="gl-flex-grow-1">
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
:loading="createTestCaseRequestActive" :loading="createTestCaseRequestActive"
:disabled="!issuableMeta.issuableTitle.length" :disabled="!issuableMeta.issuableTitle.length"
@click="handleTestCaseSubmitClick(issuableMeta)" @click="handleTestCaseSubmitClick(issuableMeta)"
>{{ __('Submit test case') }}</gl-button >{{ s__('TestCases|Submit test case') }}</gl-button
> >
</div> </div>
<gl-button <gl-button
......
<script> <script>
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale'; import { s__, __ } from '~/locale';
import createFlash from '~/flash'; import createFlash from '~/flash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { urlParamsToObject } from '~/lib/utils/common_utils'; import { urlParamsToObject } from '~/lib/utils/common_utils';
...@@ -87,7 +87,7 @@ export default { ...@@ -87,7 +87,7 @@ export default {
}, },
error(error) { error(error) {
createFlash({ createFlash({
message: __('Something went wrong while fetching test cases list.'), message: s__('TestCases|Something went wrong while fetching test cases list.'),
captureError: true, captureError: true,
error, error,
}); });
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
}, },
error(error) { error(error) {
createFlash({ createFlash({
message: __('Something went wrong while fetching count of test cases.'), message: s__('TestCases|Something went wrong while fetching count of test cases.'),
captureError: true, captureError: true,
error, error,
}); });
...@@ -333,7 +333,7 @@ export default { ...@@ -333,7 +333,7 @@ export default {
:tabs="$options.TestCaseTabs" :tabs="$options.TestCaseTabs"
:tab-counts="testCasesCount" :tab-counts="testCasesCount"
:current-tab="currentState" :current-tab="currentState"
:search-input-placeholder="__('Search test cases')" :search-input-placeholder="s__('TestCases|Search test cases')"
:search-tokens="getFilteredSearchTokens()" :search-tokens="getFilteredSearchTokens()"
:sort-options="$options.AvailableSortOptions" :sort-options="$options.AvailableSortOptions"
:initial-filter-value="getFilteredSearchValue()" :initial-filter-value="getFilteredSearchValue()"
...@@ -354,7 +354,7 @@ export default { ...@@ -354,7 +354,7 @@ export default {
> >
<template v-if="canCreateTestCase" #nav-actions> <template v-if="canCreateTestCase" #nav-actions>
<gl-button :href="testCaseNewPath" category="primary" variant="success">{{ <gl-button :href="testCaseNewPath" category="primary" variant="success">{{
__('New test case') s__('TestCases|New test case')
}}</gl-button> }}</gl-button>
</template> </template>
<template #empty-state> <template #empty-state>
......
...@@ -51,4 +51,4 @@ export const FilterStateEmptyMessage = { ...@@ -51,4 +51,4 @@ export const FilterStateEmptyMessage = {
closed: __('There are no archived test cases'), closed: __('There are no archived test cases'),
}; };
export const DEFAULT_PAGE_SIZE = 5; export const DEFAULT_PAGE_SIZE = 20;
import { mount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import TestCaseCreateRoot from 'ee/test_case_create/components/test_case_create_root.vue'; import TestCaseCreateRoot from 'ee/test_case_create/components/test_case_create_root.vue';
import createTestCase from 'ee/test_case_create/queries/create_test_case.mutation.graphql'; import createTestCase from 'ee/test_case_create/queries/create_test_case.mutation.graphql';
...@@ -6,6 +6,7 @@ import createTestCase from 'ee/test_case_create/queries/create_test_case.mutatio ...@@ -6,6 +6,7 @@ import createTestCase from 'ee/test_case_create/queries/create_test_case.mutatio
import createFlash from '~/flash'; import createFlash from '~/flash';
import { redirectTo } from '~/lib/utils/url_utility'; import { redirectTo } from '~/lib/utils/url_utility';
import IssuableCreate from '~/issuable_create/components/issuable_create_root.vue'; import IssuableCreate from '~/issuable_create/components/issuable_create_root.vue';
import IssuableForm from '~/issuable_create/components/issuable_form.vue';
jest.mock('~/flash'); jest.mock('~/flash');
jest.mock('~/lib/utils/url_utility'); jest.mock('~/lib/utils/url_utility');
...@@ -20,13 +21,17 @@ const mockProvide = { ...@@ -20,13 +21,17 @@ const mockProvide = {
}; };
const createComponent = () => const createComponent = () =>
mount(TestCaseCreateRoot, { shallowMount(TestCaseCreateRoot, {
provide: mockProvide, provide: mockProvide,
mocks: { mocks: {
$apollo: { $apollo: {
mutate: jest.fn(), mutate: jest.fn(),
}, },
}, },
stubs: {
IssuableCreate,
IssuableForm,
},
}); });
describe('TestCaseCreateRoot', () => { describe('TestCaseCreateRoot', () => {
......
...@@ -22251,9 +22251,6 @@ msgstr "" ...@@ -22251,9 +22251,6 @@ msgstr ""
msgid "Search requirements" msgid "Search requirements"
msgstr "" msgstr ""
msgid "Search test cases"
msgstr ""
msgid "Search users" msgid "Search users"
msgstr "" msgstr ""
...@@ -23718,9 +23715,6 @@ msgstr "" ...@@ -23718,9 +23715,6 @@ msgstr ""
msgid "Something went wrong while creating a requirement." msgid "Something went wrong while creating a requirement."
msgstr "" msgstr ""
msgid "Something went wrong while creating a test case."
msgstr ""
msgid "Something went wrong while deleting description changes. Please try again." msgid "Something went wrong while deleting description changes. Please try again."
msgstr "" msgstr ""
...@@ -23745,9 +23739,6 @@ msgstr "" ...@@ -23745,9 +23739,6 @@ msgstr ""
msgid "Something went wrong while fetching comments. Please try again." msgid "Something went wrong while fetching comments. Please try again."
msgstr "" msgstr ""
msgid "Something went wrong while fetching count of test cases."
msgstr ""
msgid "Something went wrong while fetching description changes. Please try again." msgid "Something went wrong while fetching description changes. Please try again."
msgstr "" msgstr ""
...@@ -23772,9 +23763,6 @@ msgstr "" ...@@ -23772,9 +23763,6 @@ msgstr ""
msgid "Something went wrong while fetching requirements list." msgid "Something went wrong while fetching requirements list."
msgstr "" msgstr ""
msgid "Something went wrong while fetching test cases list."
msgstr ""
msgid "Something went wrong while fetching the environments for this merge request. Please try again." msgid "Something went wrong while fetching the environments for this merge request. Please try again."
msgstr "" msgstr ""
...@@ -24465,9 +24453,6 @@ msgstr "" ...@@ -24465,9 +24453,6 @@ msgstr ""
msgid "Submit search" msgid "Submit search"
msgstr "" msgstr ""
msgid "Submit test case"
msgstr ""
msgid "Submit the current review." msgid "Submit the current review."
msgstr "" msgstr ""
...@@ -25011,6 +24996,27 @@ msgstr[1] "" ...@@ -25011,6 +24996,27 @@ msgstr[1] ""
msgid "Test settings" msgid "Test settings"
msgstr "" msgstr ""
msgid "TestCases|New Test Case"
msgstr ""
msgid "TestCases|New test case"
msgstr ""
msgid "TestCases|Search test cases"
msgstr ""
msgid "TestCases|Something went wrong while creating a test case."
msgstr ""
msgid "TestCases|Something went wrong while fetching count of test cases."
msgstr ""
msgid "TestCases|Something went wrong while fetching test cases list."
msgstr ""
msgid "TestCases|Submit test case"
msgstr ""
msgid "TestHooks|Ensure one of your projects has merge requests." msgid "TestHooks|Ensure one of your projects has merge requests."
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