title: Angular jest unit testing for OnClick event in PrimeNg menu bar
body: <p>Can anyone please help me to write Jest unit test for 'command' (<code>primeNg</code> Click Event) in <code>primeNg</code> menu.
  I have already covered <code>sortColumnsUp</code> function with a test case.. but still below line showing as not covered.</p>
  <pre><code>command: () =&gt; { this.sortColumnsUp(); }
  </code></pre>
  <p>How can we cover it??</p>
  <p>Here's my ts file:</p>
  <pre><code>menuOptions = [
      {
          label: “All”,
          items: [
              { label:&quot;test1&quot;, icon: &quot;arrow-icon&quot;, command: () =&gt; { this.sortOrder(); } }
          ]
      }
  ]
  
  constructor(){}
  ngOnInit() {}
  
  sortOrder(){
      //function
  }
  </code></pre>