Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/integration/components/radio-button-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module('Integration | Components | Radio Button', function (hooks) {
setupRenderingTest(hooks);

test('begins checked when groupValue matches value', async function (assert) {
assert.expect(1);
assert.expect(2);

await render(hbs`
<RadioButton
Expand All @@ -18,10 +18,11 @@ module('Integration | Components | Radio Button', function (hooks) {
`);

assert.dom('input').isChecked();
assert.dom('input').hasAttribute('aria-checked', 'true');
});

test('it updates when clicked, and triggers the `changed` action', async function (assert) {
assert.expect(5);
assert.expect(7);

let changedActionCallCount = 0;

Expand All @@ -42,10 +43,14 @@ module('Integration | Components | Radio Button', function (hooks) {

assert.strictEqual(changedActionCallCount, 0);
assert.dom('input').isNotChecked();
assert.dom('input').doesNotHaveAttribute('aria-checked');

await triggerEvent('input', 'click');

assert.dom('input').isChecked('updates element property');
assert
.dom('input')
.hasAttribute('aria-checked', 'true', 'updates aria-checked property');

assert.strictEqual(changedActionCallCount, 1);
});
Expand Down