diff --git a/addon/modifiers/did-resize.js b/addon/modifiers/did-resize.js index c840fecf..cfda42a9 100644 --- a/addon/modifiers/did-resize.js +++ b/addon/modifiers/did-resize.js @@ -1,6 +1,6 @@ import Modifier from 'ember-modifier'; -export default class DidIntersectModifier extends Modifier { +export default class DidResizeModifier extends Modifier { // Public API handler = null; diff --git a/tests/integration/modifiers/did-resize-test.js b/tests/integration/modifiers/did-resize-test.js index 078c93cf..04b4d80a 100644 --- a/tests/integration/modifiers/did-resize-test.js +++ b/tests/integration/modifiers/did-resize-test.js @@ -71,4 +71,13 @@ module('Integration | Modifier | did-resize', function (hooks) { assert.ok(element, 'element was passed to observe'); assert.equal(options, this.options, 'options were correctly passed'); }); + + test('modifier graceful no-op if ResizeObserver does not exist', async function (assert) { + delete window.ResizeObserver; + + await render(hbs`
`); + + assert.notOk(resizeCallback, 'no callback received'); + assert.notOk(observeStub.calledOnce, 'observe was not called'); + }); });