Skip to content

Commit

Permalink
fixup! Release 17.0.0-8
Browse files Browse the repository at this point in the history
  • Loading branch information
amk221 committed Dec 11, 2024
1 parent 0084a24 commit 06247b8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/integration/components/dropdown/index/api-test.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(<template>
<Dropdown @onReady={{handleReady}} as |dd|>
<dd.Trigger>
{{dd.isOpen}}
</dd.Trigger>
</Dropdown>
</template>);

assert.throws(() => {
api.isOpen = true;
}, 'read only api');
});

test('isOpen', async function (assert) {
assert.expect(2);

Expand Down
22 changes: 22 additions & 0 deletions tests/integration/components/select-box/index/api-test.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(<template>
<SelectBox @onReady={{handleReady}} as |sb|>
<sb.Dropdown>
<sb.Trigger>
{{sb.value}}
</sb.Trigger>
</sb.Dropdown>
</SelectBox>
</template>);

assert.throws(() => {
api.value = 'foo';
}, 'read only api');
});

test('provides access to the main element', async function (assert) {
assert.expect(1);

Expand Down

0 comments on commit 06247b8

Please sign in to comment.