diff --git a/tests/integration/components/dropdown/index/api-test.gjs b/tests/integration/components/dropdown/index/api-test.gjs index 5d49833d..5d0b152c 100644 --- a/tests/integration/components/dropdown/index/api-test.gjs +++ b/tests/integration/components/dropdown/index/api-test.gjs @@ -40,6 +40,26 @@ module('dropdown (api)', function (hooks) { assert.strictEqual(typeof api.toggle, 'function'); }); + test('api writing', async function (assert) { + assert.expect(1); + + let api; + + const handleReady = (sb) => (api = sb); + + await render(); + + assert.throws(() => { + api.isOpen = true; + }, 'read only api'); + }); + test('isOpen', async function (assert) { assert.expect(2); diff --git a/tests/integration/components/select-box/index/api-test.gjs b/tests/integration/components/select-box/index/api-test.gjs index ddc73cfb..272881f9 100644 --- a/tests/integration/components/select-box/index/api-test.gjs +++ b/tests/integration/components/select-box/index/api-test.gjs @@ -81,6 +81,28 @@ module('select-box (api)', function (hooks) { ); }); + test('api writing', async function (assert) { + assert.expect(1); + + let api; + + const handleReady = (sb) => (api = sb); + + await render(); + + assert.throws(() => { + api.value = 'foo'; + }, 'read only api'); + }); + test('provides access to the main element', async function (assert) { assert.expect(1);