title: How to do jasmine test case for display none css property using documet.getElementById and getElementsByClassName
body: <p>I am new to the jasmine test case I tried to do jasmine test case for selection module after doing this style property is getting undefined</p>
  
  <pre><code> function Selection() {
  
      }
      Selection.prototype.expandFlightDetails = function() {
  
          document.getElementsByClassName("flight-details-container").style.display = 'none';
          document.getElementById("expandedFlightDetails").style.display = 'block';
      };
      Selection.prototype.hideFlightDetails = function() {
          document.getElementById("expandedFlightDetails").style.display = 'none';
          document.getElementsByClassName("flight-details-container").style.display = 'block';
  
      };
  </code></pre>
  
  <p>My testcase is </p>
  
  <pre><code>describe("selection module", function() {
      var selection;
  
      beforeEach(function () {
          selection= new Selection();
  
      });
      afterEach(function () {
  
      });
      it('expand the flight details part ' , function(){
          selection.expandFlightDetails();
          expect(document.body.getElementsByClassName('flight-details-container')[0].style.display).toEqual('none');
  
      });
      xit('hide the flight details part ', function(){
          selection.hideFlightDetails();
          expect(document.getElementById('expandedFlightDetails').style.display).toEqual('none');
  
      });
  });
  </code></pre>
  
  <p>After doing this I'm geting and removed code to beforEach </p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'style' of undefined</p>
  </blockquote>
  
  <p>please correct me if I have done wrong </p>