Skip to content

Commit

Permalink
Merge pull request #1179 from emberjs/fix-canary-tests
Browse files Browse the repository at this point in the history
Fix tests on ember v6+
  • Loading branch information
NullVoxPopuli authored Sep 14, 2024
2 parents dafee6b + 5c2a131 commit bb09cb7
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions test-app/tests/integration/setup-rendering-test-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* eslint-disable ember/no-classic-components */
import { module, test } from 'qunit';
import Component from '@ember/component';
import Component, { setComponentTemplate } from '@ember/component';
import templateOnly from '@ember/component/template-only';
import { helper } from '@ember/component/helper';
import { hbs } from 'ember-cli-htmlbars';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { macroCondition, dependencySatisfies } from '@embroider/macros';

module('setupRenderingTest tests', function (hooks) {
setupRenderingTest(hooks);
Expand All @@ -16,10 +18,20 @@ module('setupRenderingTest tests', function (hooks) {
});

test('can invoke template only components', async function (assert) {
this.owner.register(
'template:components/template-only',
hbs`template-only component here`
);
if (
macroCondition(dependencySatisfies('ember-source', '>= 6.0.0-alpha.0'))
) {
this.owner.register(
'component:template-only',
setComponentTemplate(hbs`template-only component here`, templateOnly())
);
} else {
this.owner.register(
'template:components/template-only',
hbs`template-only component here`
);
}

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

assert.strictEqual(
Expand Down

0 comments on commit bb09cb7

Please sign in to comment.