Skip to content
Snippets Groups Projects
Commit 52515dda authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Phil Hughes
Browse files

Copy sidebar todo component from EE

parent e81b4f90
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -50,6 +50,9 @@ export default {
buttonLabel() {
return this.isTodo ? MARK_TEXT : TODO_TEXT;
},
buttonTooltip() {
return !this.collapsed ? undefined : this.buttonLabel;
},
collapsedButtonIconClasses() {
return this.isTodo ? 'todo-undone' : '';
},
Loading
Loading
@@ -69,7 +72,7 @@ export default {
<button
v-tooltip
:class="buttonClasses"
:title="buttonLabel"
:title="buttonTooltip"
:aria-label="buttonLabel"
:data-issuable-id="issuableId"
:data-issuable-type="issuableType"
Loading
Loading
Loading
Loading
@@ -116,7 +116,7 @@ describe('SidebarTodo', () => {
const dataAttributes = {
issuableId: '1',
issuableType: 'epic',
originalTitle: 'Mark todo as done',
originalTitle: '',
placement: 'left',
container: 'body',
boundary: 'viewport',
Loading
Loading
@@ -130,6 +130,10 @@ describe('SidebarTodo', () => {
});
});
 
it('check button label computed property', () => {
expect(vm.buttonLabel).toEqual('Mark todo as done');
});
it('renders button label element when `collapsed` prop is `false`', () => {
const buttonLabelEl = vm.$el.querySelector('span.issuable-todo-inner');
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment