Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespaced components tests does not use angle bracket #18242

Closed
chancancode opened this issue Aug 8, 2019 · 1 comment · Fixed by #18395
Closed

Namespaced components tests does not use angle bracket #18242

chancancode opened this issue Aug 8, 2019 · 1 comment · Fixed by #18395

Comments

@chancancode
Copy link
Member

chancancode commented Aug 8, 2019

ember g component-test foo

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

module('Integration | Component | foo', function(hooks) {
  setupRenderingTest(hooks);

  test('it renders', async function(assert) {
    // Set any properties with this.set('myProperty', 'value');
    // Handle any actions with this.set('myAction', function(val) { ... });

    await render(hbs`<Foo />`);

    assert.equal(this.element.textContent.trim(), '');

    // Template block usage:
    await render(hbs`
      <Foo>
        template block text
      </Foo>
    `);

    assert.equal(this.element.textContent.trim(), 'template block text');
  });
});

ember g component-test foo/bar

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

module('Integration | Component | foo/bar', function(hooks) {
  setupRenderingTest(hooks);

  test('it renders', async function(assert) {
    // Set any properties with this.set('myProperty', 'value');
    // Handle any actions with this.set('myAction', function(val) { ... });

    await render(hbs`{{foo/bar}}`);

    assert.equal(this.element.textContent.trim(), '');

    // Template block usage:
    await render(hbs`
      {{#foo/bar}}
        template block text
      {{/foo/bar}}
    `);

    assert.equal(this.element.textContent.trim(), 'template block text');
  });
});
@chancancode
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant