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