Skip to content

Commit eab4015

Browse files
koddssonkeithamus
andcommitted
Add test against errors when initializing attrs multiple times
Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
1 parent 010554f commit eab4015

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/attr.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ describe('attr', () => {
187187
expect(instance.getAttribute('data-bar')).to.equal('hello')
188188
expect(instance.getAttribute('data-baz')).to.equal('world')
189189
})
190+
191+
it('can be initialized multiple times without error', () => {
192+
const instance = document.createElement('initialize-attr-test-element')
193+
expect(instance).to.not.have.ownPropertyDescriptor('foo')
194+
initializeAttrs(instance, ['foo'])
195+
expect(instance).to.have.ownPropertyDescriptor('foo')
196+
initializeAttrs(instance, ['foo'])
197+
})
190198
})
191199

192200
describe('defineObservedAttributes', () => {

0 commit comments

Comments
 (0)