Commit aec0eb91 authored by Florie Guibert's avatar Florie Guibert

Fix epic board scope text

Changelog: fixed
parent 95175efd
......@@ -69,6 +69,11 @@ export default {
expandButtonText() {
return this.expanded ? __('Collapse') : __('Expand');
},
scopeText() {
return this.isIssueBoard
? __('Board scope affects which issues are displayed for anyone who visits this board')
: __('Board scope affects which epics are displayed for anyone who visits this board');
},
},
methods: {
......@@ -92,7 +97,7 @@ export default {
</button>
</div>
<p class="text-secondary gl-mb-3">
{{ __('Board scope affects which issues are displayed for anyone who visits this board') }}
{{ scopeText }}
</p>
<div v-if="!collapseScope || expanded">
<board-milestone-select
......
......@@ -11,16 +11,17 @@ describe('BoardScope', () => {
let wrapper;
let store;
const createStore = () => {
const createStore = ({ isIssueBoard }) => {
return new Vuex.Store({
getters: {
isIssueBoard: () => true,
isEpicBoard: () => false,
isIssueBoard: () => isIssueBoard,
isEpicBoard: () => !isIssueBoard,
},
});
};
function mountComponent() {
function mountComponent({ isIssueBoard = true } = []) {
store = createStore({ isIssueBoard });
wrapper = mount(BoardScope, {
store,
propsData: {
......@@ -41,7 +42,6 @@ describe('BoardScope', () => {
}
beforeEach(() => {
store = createStore();
mountComponent();
});
......@@ -51,7 +51,7 @@ describe('BoardScope', () => {
const findLabelSelect = () => wrapper.findComponent(LabelsSelect);
describe('ee/app/assets/javascripts/boards/components/board_scope.vue', () => {
describe('BoardScope', () => {
it('emits selected labels to be added and removed from the board', async () => {
const labels = [{ id: '1', set: true, color: '#BADA55', text_color: '#FFFFFF' }];
expect(findLabelSelect().exists()).toBe(true);
......@@ -62,4 +62,13 @@ describe('BoardScope', () => {
expect(wrapper.emitted('set-board-labels')).toEqual([[labels]]);
});
});
it.each`
isIssueBoard | text
${true} | ${'Board scope affects which issues are displayed for anyone who visits this board'}
${false} | ${'Board scope affects which epics are displayed for anyone who visits this board'}
`('displays $text when isIssueBoard is $isIssueBoard', ({ isIssueBoard, text }) => {
mountComponent({ isIssueBoard });
expect(wrapper.find('p.text-secondary').text()).toEqual(text);
});
});
......@@ -5431,6 +5431,9 @@ msgstr ""
msgid "Blog"
msgstr ""
msgid "Board scope affects which epics are displayed for anyone who visits this board"
msgstr ""
msgid "Board scope affects which issues are displayed for anyone who visits this board"
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