<commit_before>import { module, test, skip } from "qunit";
import { setupRenderingTest } from "ember-qunit";
import { render } from "@ember/test-helpers";
import hbs from "htmlbars-inline-precompile";
import Component from "@ember/component";
import { gte } from "ember-compatibility-helpers";

module("Integration | Component | component-with-link-to-external", function(
  hooks
) {
  setupRenderingTest(hooks);

  hooks.beforeEach(function() {
    let testComponent = Component.extend();
    this.owner.register("component:test-component", testComponent);

    // setup an external route manually
    this.owner._externalRoutes['home'] = 'application';
  });

  test("component renders with link-to-external [curly braces]", async function(assert) {
    assert.expect(1);

    await render(hbs`
    {{#test-component}}
      {{#link-to "view"}}Link To{{/link-to}}
      {{#link-to-external "home"}}Link To External{{/link-to-external}}
    {{/test-component}}
  `);

    assert.ok(this.element);
  });
<commit_msg>Ensure rendering tests with link-to's have valid routes.<commit_after>import { module, test, skip } from "qunit";
import { setupRenderingTest } from "ember-qunit";
import { render } from "@ember/test-helpers";
import hbs from "htmlbars-inline-precompile";
import Component from "@ember/component";
import EmberRouter from '@ember/routing/router';
import { gte } from "ember-compatibility-helpers";

module("Integration | Component | component-with-link-to-external", function(
  hooks
) {
  setupRenderingTest(hooks);

  hooks.beforeEach(function() {
    let testComponent = Component.extend();
    this.owner.register("component:test-component", testComponent);

    class Router extends EmberRouter {}
    Router.map(function() {
      this.route('view');
    });
    this.owner.register('router:main', Router);

    // setup an external route manually
    this.owner._externalRoutes['home'] = 'application';
  });

  test("component renders with link-to-external [curly braces]", async function(assert) {
    assert.expect(1);

    await render(hbs`
    {{#test-component}}
      {{#link-to "view"}}Link To{{/link-to}}
      {{#link-to-external "home"}}Link To External{{/link-to-external}}
    {{/test-component}}
  `);

    assert.ok(this.element);
  });

{'fraction_non_alphanumeric': 0.1572244180939833, 'fraction_numerical': 0.000878348704435661, 'mean_word_length': 4.224770642201835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5939457', 'n_tokens_mistral': 691, 'n_tokens_neox': 691, 'n_words': 151}