-
Notifications
You must be signed in to change notification settings - Fork 407
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): add tests for objects with computed key
- Loading branch information
1 parent
2e5bf3d
commit 5a2358b
Showing
3 changed files
with
35 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
3 changes: 3 additions & 0 deletions
3
packages/@lwc/integration-karma/test/lwc-on/x/computedKey/computedKey.html
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,3 @@ | ||
<template> | ||
<button lwc:on={eventHandlers}>Click Me</button> | ||
</template> |
20 changes: 20 additions & 0 deletions
20
packages/@lwc/integration-karma/test/lwc-on/x/computedKey/computedKey.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,20 @@ | ||
import { LightningElement, api } from 'lwc'; | ||
|
||
let testFn; | ||
const mouseover = 'click'; | ||
|
||
export default class ComputedKey extends LightningElement { | ||
@api | ||
get testFn() { | ||
return testFn; | ||
} | ||
set testFn(val) { | ||
testFn = val; | ||
} | ||
|
||
eventHandlers = { | ||
[mouseover]: function () { | ||
testFn(); | ||
}, | ||
}; | ||
} |