Skip to content

Commit

Permalink
added todo for testing get-element when invalid callback is supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchadwick committed Dec 20, 2024
1 parent 9fe39b1 commit aa4f20b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/test-app/tests/integration/modifiers/get-element-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { module, test } from 'qunit';
import { module, test, todo } from 'qunit';
import { setupRenderingTest } from 'test-app/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
Expand All @@ -16,10 +16,16 @@ module('Integration | Modifier | get-element', function (hooks) {
assert.strictEqual(this.rootElement, document.getElementById('root-element'));
});

test('it fails when no callback is given', async function (assert) {
this.rootElement = null;
assert.strictEqual(this.rootElement, null);
await render(hbs`<div id='root-element' {{get-element}}></div>`);
assert.strictEqual(this.rootElement, null);
todo('it fails when no callback is given', async function (assert) {
assert.expect(1);

// const renderWithoutCallback = async () => {
// await render(hbs`<div {{get-element}}></div>`);
// };
// assert.throws(
// renderWithoutCallback,
// /get-element modifier expects a valid callback as the first positional argument/,
// 'Throws an error when invalid callback is provided',
// );
});
});

0 comments on commit aa4f20b

Please sign in to comment.