Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #115 from ckeditor/t/109
Browse files Browse the repository at this point in the history
Feature: URL input field should provide a placeholder. Closes #109.
  • Loading branch information
oskarwrobel authored May 11, 2017
2 parents 2de1674 + 31ac147 commit 6d18c55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ui/linkformview.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export default class LinkFormView extends View {
const labeledInput = new LabeledInputView( this.locale, InputTextView );

labeledInput.label = t( 'Link URL' );
labeledInput.inputView.placeholder = t( 'http://example.com' );

return labeledInput;
}
Expand Down
8 changes: 7 additions & 1 deletion tests/ui/linkformview.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe( 'LinkFormView', () => {
let view;

beforeEach( () => {
view = new LinkFormView( { t: () => {} } );
view = new LinkFormView( { t: ( val ) => val } );

return view.init();
} );
Expand Down Expand Up @@ -97,6 +97,12 @@ describe( 'LinkFormView', () => {
expect( spy.calledOnce ).to.true;
} );

describe( 'url input view', () => {
it( 'has placeholder', () => {
expect( view.urlInputView.inputView.placeholder ).to.equal( 'http://example.com' );
} );
} );

describe( 'template', () => {
it( 'has url input view', () => {
expect( view.template.children.get( 0 ) ).to.equal( view.urlInputView );
Expand Down

0 comments on commit 6d18c55

Please sign in to comment.