How to testing treenode click #146
Replies: 1 comment
-
Hi, The question is not clear, could you please explain what you mean by "I would like to test doStuff() method is called on a treenode click"? And if possible, please share a stackblitz example so we can clearly identify the issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Can someone tell me how i can test a treenode event click please?
I have a parent component wiwh contains a child :
@Component({
selector:'app-parent-component',
template: ' < p > {{ selectedPet }} < /p>
<p-tree [value]="pets" selectionMode="single" [(selection)]="selectedPet" (onNodeSelect)="doStuff($event)">
'
export class ParentComponent {
public selectedPet = null;
public pets = [ { id:1, animal: 'dog'}, { id:2, animal: 'cat'}, { id:3, animal: 'parrot'} ];
doStuff(event) {
console.log(event) // and do stuff
}
}
I would like to test doStuff() method is called on a treenode click but i don't know how i can do that.
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions