Skip to content

Commit

Permalink
Fix tests on ember canary
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Sep 14, 2024
1 parent dafee6b commit 5c2a131
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 5c2a131

Please sign in to comment.