<commit_before>import { assertSuccess, assertAnnotated, assertFailure } from './testHelper';
import chai = require('chai');

describe('template-to-ng-template', () => {
  it('should skip elements with *-prefixed attr', () => {
    let source = `
      @Component({
        selector: 'foobar',
        template: '<section><div *ngIf="42"></div></section>'
      })
      class Test {}`;
      assertSuccess('template-to-ng-template', source);
  });

  it('should detect templete elements', () => {
    let source = `
      @Component({
        selector: 'foobar',
        template: '<section><template [ngForOf]></template></div>'
                            ~~~~~~~~~~~~~~~~~~~~
      })
      class Test {}`;
      assertAnnotated({
        ruleName: 'template-to-ng-template',
        message: 'You should use <ng-template/> instead of <template/>',
        source
      });
  });

  it('should detect templete elements', () => {
    let source = `
      @Component({
        selector: 'foobar',
        template: '<section><template [ngForOf]><br></template></div>'
                            ~~~~~~~~~~~~~~~~~~~~
      })
      class Test {}`;
      assertAnnotated({
        ruleName: 'template-to-ng-template',
        message: 'You should use <ng-template/> instead of <template/>',
        source
      });
  });

  it('should detect templete elements', () => {
    let source = `
      @Component({
        selector: 'foobar',
        template: \`<section>
          <template [ngForOf]><div/>
          ~~~~~~~~~~~~~~~~~~~~
          </template></div>\`
      })
      class Test {}`;
      assertAnnotated({
        ruleName: 'template-to-ng-template',
        message: 'You should use <ng-template/> instead of <template/>',
        source
      });
  });

  describe('autofixes', () => {

    it('should not autofix template suggar', () => {<commit_msg>fix: disable tests for not active feature<commit_after>import { assertSuccess, assertAnnotated, assertFailure } from './testHelper';
import chai = require('chai');

describe('template-to-ng-template', () => {
  it('should skip elements with *-prefixed attr', () => {
    let source = `
      @Component({
        selector: 'foobar',
        template: '<section><div *ngIf="42"></div></section>'
      })
      class Test {}`;
      assertSuccess('template-to-ng-template', source);
  });

  it('should detect templete elements', () => {
    let source = `
      @Component({
        selector: 'foobar',
        template: '<section><template [ngForOf]></template></div>'
                            ~~~~~~~~~~~~~~~~~~~~
      })
      class Test {}`;
      assertAnnotated({
        ruleName: 'template-to-ng-template',
        message: 'You should use <ng-template/> instead of <template/>',
        source
      });
  });

  it('should detect templete elements', () => {
    let source = `
      @Component({
        selector: 'foobar',
        template: '<section><template [ngForOf]><br></template></div>'
                            ~~~~~~~~~~~~~~~~~~~~
      })
      class Test {}`;
      assertAnnotated({
        ruleName: 'template-to-ng-template',
        message: 'You should use <ng-template/> instead of <template/>',
        source
      });
  });

  it('should detect templete elements', () => {
    let source = `
      @Component({
        selector: 'foobar',
        template: \`<section>
          <template [ngForOf]><div/>
          ~~~~~~~~~~~~~~~~~~~~
          </template></div>\`
      })
      class Test {}`;
      assertAnnotated({
        ruleName: 'template-to-ng-template',
        message: 'You should use <ng-template/> instead of <template/>',
        source
      });
  });

  xdescribe('autofixes', () => {

    it('should not autofix template suggar', () => {
{'fraction_non_alphanumeric': 0.19425989901674195, 'fraction_numerical': 0.0010629816635663034, 'mean_word_length': 2.219846022241232, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4533833', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1038, 'n_words': 234}