diff --git a/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/user-context-filter.js b/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/user-context-filter.js
index 0d8545b759..7252374522 100644
--- a/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/user-context-filter.js
+++ b/packages/ilios-common/addon-test-support/ilios-common/page-objects/components/dashboard/user-context-filter.js
@@ -1,27 +1,21 @@
-import { create, property } from 'ember-cli-page-object';
+import { clickable, create, property, text } from 'ember-cli-page-object';
const definition = {
scope: '[data-test-dashboard-user-context-filter]',
- instructingLabel: {
- scope: '[data-test-instructing-label]',
+ instructing: {
+ isChecked: property('checked', '[data-test-instructing-input]'),
+ label: text('[data-test-instructing-label]'),
+ toggle: clickable('[data-test-instructing-label]'),
},
- instructingInput: {
- scope: '[data-test-instructing-input]',
- isChecked: property('checked'),
+ learning: {
+ isChecked: property('checked', '[data-test-learning-input]'),
+ label: text('[data-test-learning-label]'),
+ toggle: clickable('[data-test-learning-label]'),
},
- learningLabel: {
- scope: '[data-test-learning-label]',
- },
- learningInput: {
- scope: '[data-test-learning-input]',
- isChecked: property('checked'),
- },
- adminLabel: {
- scope: '[data-test-admin-label]',
- },
- adminInput: {
- scope: '[data-test-admin-input]',
- isChecked: property('checked'),
+ admin: {
+ isChecked: property('checked', '[data-test-admin-input]'),
+ label: text('[data-test-admin-label]'),
+ toggle: clickable('[data-test-admin-label]'),
},
};
diff --git a/packages/test-app/tests/integration/components/dashboard/user-context-filter-test.js b/packages/test-app/tests/integration/components/dashboard/user-context-filter-test.js
index 9db1eb0943..c15dd336d1 100644
--- a/packages/test-app/tests/integration/components/dashboard/user-context-filter-test.js
+++ b/packages/test-app/tests/integration/components/dashboard/user-context-filter-test.js
@@ -11,12 +11,12 @@ module('Integration | Component | dashboard/user-context-filter', function (hook
test('it renders', async function (assert) {
await render(hbs``);
- assert.strictEqual(component.instructingLabel.text, 'Instructing');
- assert.notOk(component.instructingInput.isChecked);
- assert.strictEqual(component.learningLabel.text, 'Learning');
- assert.notOk(component.learningInput.isChecked);
- assert.strictEqual(component.adminLabel.text, 'Admin');
- assert.notOk(component.adminInput.isChecked);
+ assert.strictEqual(component.instructing.label, 'Instructing');
+ assert.notOk(component.instructing.isChecked);
+ assert.strictEqual(component.learning.label, 'Learning');
+ assert.notOk(component.learning.isChecked);
+ assert.strictEqual(component.admin.label, 'Admin');
+ assert.notOk(component.admin.isChecked);
});
test('selecting learning filter', async function (assert) {
@@ -25,8 +25,8 @@ module('Integration | Component | dashboard/user-context-filter', function (hook
assert.strictEqual(context, 'learner');
});
await render(hbs``);
- assert.notOk(component.learningInput.isChecked);
- await component.learningLabel.click();
+ assert.notOk(component.learning.isChecked);
+ await component.learning.toggle();
});
test('de-selecting learning filter', async function (assert) {
@@ -38,8 +38,8 @@ module('Integration | Component | dashboard/user-context-filter', function (hook
await render(
hbs``,
);
- assert.ok(component.learningInput.isChecked);
- await component.learningLabel.click();
+ assert.ok(component.learning.isChecked);
+ await component.learning.toggle();
});
test('selecting instructing filter', async function (assert) {
@@ -48,8 +48,8 @@ module('Integration | Component | dashboard/user-context-filter', function (hook
assert.strictEqual(context, 'instructor');
});
await render(hbs``);
- assert.notOk(component.instructingInput.isChecked);
- await component.instructingInput.click();
+ assert.notOk(component.instructing.isChecked);
+ await component.instructing.toggle();
});
test('de-selecting instructing filter', async function (assert) {
@@ -61,8 +61,8 @@ module('Integration | Component | dashboard/user-context-filter', function (hook
await render(
hbs``,
);
- assert.ok(component.instructingInput.isChecked);
- await component.instructingLabel.click();
+ assert.ok(component.instructing.isChecked);
+ await component.instructing.toggle();
});
test('selecting admin filter', async function (assert) {
@@ -71,8 +71,8 @@ module('Integration | Component | dashboard/user-context-filter', function (hook
assert.strictEqual(context, 'administrator');
});
await render(hbs``);
- assert.notOk(component.adminInput.isChecked);
- await component.adminInput.click();
+ assert.notOk(component.admin.isChecked);
+ await component.admin.toggle();
});
test('de-selecting admin filter', async function (assert) {
@@ -84,7 +84,7 @@ module('Integration | Component | dashboard/user-context-filter', function (hook
await render(
hbs``,
);
- assert.ok(component.adminInput.isChecked);
- await component.adminLabel.click();
+ assert.ok(component.admin.isChecked);
+ await component.admin.toggle();
});
});