Commit e70bdbd6 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch 'jivanvl-update-merge-train-message' into 'master'

Change merge train position messaging

See merge request gitlab-org/gitlab!40777
parents eb64cbd8 21fc1b56
......@@ -11,9 +11,19 @@ export default {
},
computed: {
message() {
return sprintf(s__('mrWidget|In the merge train at position %{mergeTrainPosition}'), {
const messageBeginningTrainPosition = s__(
'mrWidget|A new merge train has started and this merge request is the first of the queue.',
);
const messageAddedTrainPosition = sprintf(
s__(
'mrWidget|Added to the merge train. There are %{mergeTrainPosition} merge requests waiting to be merged',
),
{
mergeTrainPosition: this.mergeTrainIndex + 1,
});
},
);
return this.mergeTrainIndex === 0 ? messageBeginningTrainPosition : messageAddedTrainPosition;
},
},
};
......
---
title: Change merge train position messaging
merge_request: 40777
author:
type: changed
......@@ -4,14 +4,11 @@ import MergeTrainPositionIndicator from 'ee/vue_merge_request_widget/components/
describe('MergeTrainPositionIndicator', () => {
let wrapper;
let vm;
const factory = propsData => {
wrapper = shallowMount(MergeTrainPositionIndicator, {
propsData,
});
({ vm } = wrapper);
};
afterEach(() => {
......@@ -19,19 +16,21 @@ describe('MergeTrainPositionIndicator', () => {
});
describe('computed', () => {
describe('message', () => {
it('should return the message with the correct position (i.e., index + 1)', () => {
describe('template', () => {
it('should render the correct message', () => {
factory({ mergeTrainIndex: 3 });
expect(vm.message).toBe('In the merge train at position 4');
});
expect(trimText(wrapper.text())).toBe(
'Added to the merge train. There are 4 merge requests waiting to be merged',
);
});
describe('template', () => {
it('should render the correct message', () => {
factory({ mergeTrainIndex: 3 });
it('should change the merge train message when the position is 1', () => {
factory({ mergeTrainIndex: 0 });
expect(trimText(wrapper.text())).toBe('In the merge train at position 4');
expect(trimText(wrapper.text())).toBe(
'A new merge train has started and this merge request is the first of the queue.',
);
});
});
});
......
......@@ -29534,9 +29534,15 @@ msgstr ""
msgid "mrWidget|%{prefixToLinkStart}No pipeline%{prefixToLinkEnd} %{addPipelineLinkStart}Add the .gitlab-ci.yml file%{addPipelineLinkEnd} to create one."
msgstr ""
msgid "mrWidget|A new merge train has started and this merge request is the first of the queue."
msgstr ""
msgid "mrWidget|Added to the merge train by"
msgstr ""
msgid "mrWidget|Added to the merge train. There are %{mergeTrainPosition} merge requests waiting to be merged"
msgstr ""
msgid "mrWidget|Allows commits from members who can merge to the target branch"
msgstr ""
......@@ -29624,9 +29630,6 @@ msgstr ""
msgid "mrWidget|If the %{missingBranchName} branch exists in your local repository, you can merge this merge request manually using the command line"
msgstr ""
msgid "mrWidget|In the merge train at position %{mergeTrainPosition}"
msgstr ""
msgid "mrWidget|Jump to first unresolved thread"
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