Skip to content

Commit

Permalink
fix: bold in toolbar not working (close nhn#143)(nhn#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyuwoo-choi authored and kyuwoo.choi committed Apr 17, 2018
1 parent 455cdb2 commit 8059159
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/ui/toolbarItemFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ToolbarItemFactory {
toolbarItem = new ToolbarButton({
name: 'bold',
className: 'tui-bold',
command: 'bold',
command: 'Bold',
tooltip: i18n.get('Bold'),
state: 'bold'
});
Expand Down
19 changes: 19 additions & 0 deletions test/ui/toolbarItemFactory.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,24 @@ describe('ToolbarItemFactory', () => {
expect(ToolbarItemFactory.create('outdent').getName()).toBe('outdent');
expect(ToolbarItemFactory.create('item').getName()).toBe('item');
});

it('should create items of commands/events', () => {
expect(ToolbarItemFactory.create('heading')._event).toBe('openHeadingSelect');
expect(ToolbarItemFactory.create('bold')._command).toBe('Bold');
expect(ToolbarItemFactory.create('italic')._command).toBe('Italic');
expect(ToolbarItemFactory.create('strike')._command).toBe('Strike');
expect(ToolbarItemFactory.create('hr')._command).toBe('HR');
expect(ToolbarItemFactory.create('quote')._command).toBe('Blockquote');
expect(ToolbarItemFactory.create('ul')._command).toBe('UL');
expect(ToolbarItemFactory.create('ol')._command).toBe('OL');
expect(ToolbarItemFactory.create('task')._command).toBe('Task');
expect(ToolbarItemFactory.create('table')._event).toBe('openPopupAddTable');
expect(ToolbarItemFactory.create('image')._event).toBe('openPopupAddImage');
expect(ToolbarItemFactory.create('link')._event).toBe('openPopupAddLink');
expect(ToolbarItemFactory.create('code')._command).toBe('Code');
expect(ToolbarItemFactory.create('codeblock')._command).toBe('CodeBlock');
expect(ToolbarItemFactory.create('indent')._command).toBe('Indent');
expect(ToolbarItemFactory.create('outdent')._command).toBe('Outdent');
});
});
});

0 comments on commit 8059159

Please sign in to comment.