-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(integration-karma): test CustomElementConstructor attributes (#3505
- Loading branch information
1 parent
736ef6e
commit 5a6188e
Showing
3 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...c/integration-karma/test/api/CustomElementConstructor-getter/x/attrChanged/attrChanged.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { LightningElement, track, api } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
@api attributeChangedCallbackCalls = []; | ||
@api apiSetterCallCounts = 0; | ||
|
||
_api; | ||
@track track; | ||
|
||
get api() { | ||
return this._api; | ||
} | ||
@api | ||
set api(val) { | ||
this.apiSetterCallCounts++; | ||
this._api = val; | ||
} | ||
|
||
attributeChangedCallback(attrName, oldValue, newValue) { | ||
this.attributeChangedCallbackCalls.push([attrName, oldValue, newValue]); | ||
} | ||
|
||
static observedAttributes = ['observed']; | ||
} |
5 changes: 5 additions & 0 deletions
5
...integration-karma/test/api/CustomElementConstructor-getter/x/reflectCamel/reflectCamel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { LightningElement, api } from 'lwc'; | ||
|
||
export default class extends LightningElement { | ||
@api myProp; | ||
} |