Skip to content

Commit

Permalink
Merge pull request #297 from ryecroft/data_properties
Browse files Browse the repository at this point in the history
Add failing test for default-valued properties
  • Loading branch information
keithamus authored Dec 3, 2024
2 parents a874af9 + 5f8d9da commit d352596
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/attrable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ describe('Attrable', () => {
this.setCount += 1
this.#bing = value
}
lastSetHasFoo: any

Check warning on line 22 in test/attrable.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js

Unexpected any. Specify a different type
@attr get hasFoo() {
return false
}
set hasFoo(v: boolean) {
this.lastSetHasFoo = v
}
connectedCallback() {
this.hasFoo = true
}
}
window.customElements.define('initialize-attr-test', InitializeAttrTest)

Expand Down Expand Up @@ -104,6 +114,10 @@ describe('Attrable', () => {
instance.bingBaz = 'universe'
expect(instance).to.have.property('bingBaz', 'universe')
})

Check failure on line 117 in test/attrable.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js

Delete `····`
it('updates default-valued properties in the connected callback', async () => {
expect(instance).to.have.property('lastSetHasFoo', true)
})
}

describe('types', () => {
Expand Down

0 comments on commit d352596

Please sign in to comment.