Skip to content

Commit

Permalink
fix: better test and logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed Jul 26, 2021
1 parent aae0e72 commit 4385bd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/picker/PickerElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class PickerElement extends HTMLElement {
}
// Handle properties set before the element was upgraded
for (const prop of PROPS) {
if (prop !== 'database' && typeof this[prop] !== 'undefined') {
if (prop !== 'database' && Object.hasOwnProperty.call(this, prop)) {
this._ctx[prop] = this[prop]
}
}
Expand Down
4 changes: 4 additions & 0 deletions test/spec/picker/upgrade.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ describe('upgrade tests', () => {
expect(picker.locale).toEqual('fr')
expect(picker.dataSource).toEqual(FR_EMOJI)

picker.skinToneEmoji = '✌'

await waitFor(() => expect(getByRole(container, 'menuitem', { name: /👍/ })).toBeVisible())

document.body.removeChild(div)
await tick(20)
})
Expand Down

0 comments on commit 4385bd0

Please sign in to comment.