title: Sinon JQuery selectors mock
body: <p>I am trying to test a function using mocha/sinonjs. The function I want to test is responsible for showing or hiding some element in my DOM.</p>
  
  <p>This is my function</p>
  
  <pre><code>var updateUI = function() {
    $('#login').show();
    $('#logout').hide();
  };
  </code></pre>
  
  <p>I tried to mock using sinon but I'm not sure if it is possible or the correct thing to do in this case.</p>
  
  <p>This is what I have tried but I keep getting an error <code>"TypeError: undefined is not a function"</code> during the <code>expect</code> call</p>
  
  <pre><code> var mockLogin = sinon.mock($);
   mockLogin.withArgs('#login').expects("show").once();
  </code></pre>
  
  <p>I simple want to test my 2 jquery calls have been called. I tried to use spies but continue to get exceptions </p>