Commit 21fc1b56 authored by Jose Vargas's avatar Jose Vargas

Change merge train position messaging

This changes the merge train mr widget
message content and related tests
parent 650f3ad4
......@@ -11,9 +11,19 @@ export default {
},
computed: {
message() {
return sprintf(s__('mrWidget|In the merge train at position %{mergeTrainPosition}'), {
mergeTrainPosition: this.mergeTrainIndex + 1,
});
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.',
);
});
});
});
......
......@@ -29525,9 +29525,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 ""
......@@ -29615,9 +29621,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