title: Unit testing angular and jasmine
body: <p>How does one go about unit testing in angular something in the index.html file?</p>
  
  <p>For example:  I want to create a unit test that checks that the body tag has a specific class assigned to it.  Is this possible</p>
  
  <p>Most unit test or spec files are made for components but I cant seem to access the body tag.</p>
  
  <p>this is a working css unit test for anything inside a component, just no idea how to get access to the body tag of the index.html page.</p>
  
  <pre><code>
    it('should have class-name in body class tag', () =&gt; {
      const fixture = TestBed.createComponent(AppComponent);
  
      fixture.detectChanges();
      const compiled = fixture.debugElement;
  
      expect(compiled.query(By.css('.class-name'))).toBeTruthy();
    });
  
  </code></pre>