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