Skip to content

Commit

Permalink
Update demo and test wording
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriy-fix committed Aug 24, 2018
1 parent 2f7df7a commit 2797c73
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 5 additions & 3 deletions demo/dropdown-menu-basic-demos.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ <h3>Basic Usage</h3>

<h3>Using renderer</h3>
<p>
By default the overlay is using Polymer's Templatizer and stamp/update the instances.
User is able to provide `renderer` function to render the content.
`renderer` function is prioritized over the default implementation.
By default, the dropdown uses the content from its template using Polymer.Templatize.
Alternatively, the content can be provided using the renderer callback function.
</p>
<p>
<strong>NOTE:</strong> When the renderer property is defined, the <code>&lt;template&gt;</code> content is not used.
</p>
<vaadin-demo-snippet id="dropdown-menu-list-box-renderer">
<template preserve-content>
Expand Down
2 changes: 1 addition & 1 deletion src/vaadin-dropdown-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
},

/**
* Custom function for rendering the content of the overlay
* Custom function for rendering the content of the dropdown
*/
renderer: {
type: Function,
Expand Down
8 changes: 4 additions & 4 deletions test/renderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

it('should use renderer when it is defined', () => {
dropdown.renderer = root => root.appendChild(rendererContent);
expect(dropdown.shadowRoot.querySelector('vaadin-list-box mock-item').textContent.trim()).to.be.eql('renderer item');
expect(dropdown.shadowRoot.querySelector('vaadin-list-box mock-item').textContent.trim()).to.equal('renderer item');
});

it('should pass vaadin-dialog as owner to vaadin-overlay', () => {
Expand All @@ -66,7 +66,7 @@
beforeEach(() => dropdown = fixture('with-template'));

it('should fallback to render content with Templatizer when renderer is not defined', () => {
expect(dropdown.shadowRoot.querySelector('vaadin-list-box mock-item').textContent.trim()).to.be.eql('templatizer item');
expect(dropdown.shadowRoot.querySelector('vaadin-list-box mock-item').textContent.trim()).to.equal('templatizer item');
});

it('renderer should receive empty root when defined after template', () => {
Expand All @@ -75,9 +75,9 @@

it('the initial template instance should be used after renderer was assigned and removed', () => {
dropdown.renderer = root => root.appendChild(rendererContent);
expect(dropdown.shadowRoot.querySelector('vaadin-list-box mock-item').textContent.trim()).to.be.eql('renderer item');
expect(dropdown.shadowRoot.querySelector('vaadin-list-box mock-item').textContent.trim()).to.equal('renderer item');
dropdown.renderer = null;
expect(dropdown.shadowRoot.querySelector('vaadin-list-box mock-item').textContent.trim()).to.be.eql('templatizer item');
expect(dropdown.shadowRoot.querySelector('vaadin-list-box mock-item').textContent.trim()).to.equal('templatizer item');
});
});
});
Expand Down

0 comments on commit 2797c73

Please sign in to comment.