lundi 21 janvier 2019

write test for a javascript if-else code-snippet

I have this code-snippet in a jsx file:

let findYourArticleTraining;
    if (Features.wikiEd && !assignmentCount) {
      course={this.props.course}
      if (course.type == 'some_type'){
        some_section = (
        <a href="/training/professional-development/finding-your-article-professional" target="_blank" className="button ghost-button small">
          How to find an article
        </a>);}
      if (course.type != 'some_type'){
      some_section = (
        <a href="/training/students/finding-your-article" target="_blank" className="button ghost-button small">
          How to find an article
        </a>);}
    }

How to write tests for it in jasmine testing framework? Any help or suggestion will be appreciated.

Aucun commentaire:

Enregistrer un commentaire