Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchadwick committed Nov 26, 2024
1 parent b666adc commit 3765dca
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module('Acceptance | Course - Competencies', function (hooks) {
details: true,
courseObjectiveDetails: true,
});
await page.details.objectives.objectiveList.objectives[1].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[1].parents.manage();
const m = page.details.objectives.objectiveList.objectives[1].parentManager;
await m.competencies[1].objectives[0].add();
assert.ok(m.competencies[0].objectives[0].notSelected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { setupApplicationTest } from 'frontend/tests/helpers';
import page from 'ilios-common/page-objects/course';
import percySnapshot from '@percy/ember';

module('Acceptance | Course - Multiple Objective Parents', function (hooks) {
module('Acceptance | Course - Multiple Objective Parents', function (hooks) {
setupApplicationTest(hooks);
hooks.beforeEach(async function () {
this.user = await setupAuthentication();
Expand Down Expand Up @@ -65,7 +65,7 @@ module('Acceptance | Course - Multiple Objective Parents', function (hooks) {
'program-year objective 1',
);

await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

assert.strictEqual(m.selectedCohortTitle, 'program 0 cohort 0');
Expand All @@ -92,7 +92,7 @@ module('Acceptance | Course - Multiple Objective Parents', function (hooks) {
page.details.objectives.objectiveList.objectives[0].description.text,
'course objective 0',
);
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

await m.competencies[0].objectives[2].add();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module('Acceptance | Course - Objective Inactive Parents', function (hooks) {
assert.strictEqual(objectives[0].parents.list.length, 1);
assert.strictEqual(objectives[0].parents.list[0].text, 'inactive selected');

await objectives[0].parents.list[0].manage();
await objectives[0].parents.manage();
const m = objectives[0].parentManager;

assert.strictEqual(m.selectedCohortTitle, 'program 0 cohort 0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module('Acceptance | Course with multiple Cohorts - Objective Parents', function
page.details.objectives.objectiveList.objectives[0].parents.list[1].text,
'program-year objective 3',
);
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

await m.selectCohort(1);
Expand Down Expand Up @@ -135,7 +135,7 @@ module('Acceptance | Course with multiple Cohorts - Objective Parents', function
page.details.objectives.objectiveList.objectives[0].parents.list[1].text,
'program-year objective 3',
);
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

await m.selectCohort(1);
Expand Down Expand Up @@ -185,7 +185,7 @@ module('Acceptance | Course with multiple Cohorts - Objective Parents', function
page.details.objectives.objectiveList.objectives[0].parents.list[1].text,
'program-year objective 3',
);
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

await m.selectCohort(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module('Acceptance | Course with no cohorts - Objective Parents', function (hook

assert.strictEqual(firstObjective.description.text, 'course objective 0');
assert.ok(firstObjective.parents.empty);
await firstObjective.parents.list[0].manage();
await firstObjective.parents.manage();
const m = firstObjective.parentManager;

assert.ok(m.hasNoCohortWarning);
Expand All @@ -50,7 +50,7 @@ module('Acceptance | Course with no cohorts - Objective Parents', function (hook
await page.details.cohorts.selectable[0].add();
await page.details.cohorts.save();
assert.strictEqual(page.details.cohorts.current.length, 1);
await firstObjective.parents.list[0].manage();
await firstObjective.parents.manage();

assert.strictEqual(m.selectedCohortTitle, 'program 0 cohort 0');
assert.strictEqual(m.competencies.length, 1);
Expand All @@ -64,7 +64,7 @@ module('Acceptance | Course with no cohorts - Objective Parents', function (hook
await page.details.cohorts.selected[0].remove();
await page.details.cohorts.save();
assert.strictEqual(page.details.cohorts.current.length, 0);
await firstObjective.parents.list[0].manage();
await firstObjective.parents.manage();
assert.ok(m.hasNoCohortWarning);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module('Acceptance | Course - Objective Parents', function (hooks) {
'program-year objective 0',
);

await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

assert.strictEqual(m.selectedCohortTitle, 'program 0 cohort 0');
Expand Down Expand Up @@ -108,7 +108,7 @@ module('Acceptance | Course - Objective Parents', function (hooks) {
);

await percySnapshot(getUniqueName(assert, 'default background color'));
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
await percySnapshot(getUniqueName(assert, 'default background color'));

const m = page.details.objectives.objectiveList.objectives[0].parentManager;
Expand Down Expand Up @@ -152,7 +152,7 @@ module('Acceptance | Course - Objective Parents', function (hooks) {
);

await percySnapshot(getUniqueName(assert, 'default background color'));
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
await percySnapshot(getUniqueName(assert, 'managed background color'));

const m = page.details.objectives.objectiveList.objectives[0].parentManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module('Acceptance | Course - Publish All Sessions', function (hooks) {
assert.ok(page.publishAll.isVisible);
assert.ok(page.publishAll.hasUnlinkedWarning);

await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;
await m.competencies[0].objectives[0].add();
await page.details.objectives.objectiveList.objectives[0].parents.save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module('Acceptance | Session - Objective Parents', function (hooks) {
);

await percySnapshot(getUniqueName(assert, 'default background color'));
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
await percySnapshot(getUniqueName(assert, 'managed background color'));

const m = page.details.objectives.objectiveList.objectives[0].parentManager;
Expand Down Expand Up @@ -90,7 +90,7 @@ module('Acceptance | Session - Objective Parents', function (hooks) {
);

await percySnapshot(getUniqueName(assert, 'default background color'));
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
await percySnapshot(getUniqueName(assert, 'managed background color'));

const m = page.details.objectives.objectiveList.objectives[0].parentManager;
Expand Down Expand Up @@ -142,7 +142,7 @@ module('Acceptance | Session - Objective Parents', function (hooks) {
);

await percySnapshot(getUniqueName(assert, 'default background color'));
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
await percySnapshot(getUniqueName(assert, 'managed background color'));

const m = page.details.objectives.objectiveList.objectives[0].parentManager;
Expand Down Expand Up @@ -194,7 +194,7 @@ module('Acceptance | Session - Objective Parents', function (hooks) {
);

await percySnapshot(getUniqueName(assert, 'default background color'));
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
await percySnapshot(getUniqueName(assert, 'managed background color'));

const m = page.details.objectives.objectiveList.objectives[0].parentManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { clickable, create, collection, isHidden, isPresent } from 'ember-cli-pa

const definition = {
scope: '[data-test-objective-list-item-parents]',
list: collection('li', {
manage: clickable('[data-test-manage]'),
}),
list: collection('li'),
manage: clickable('[data-test-manage]'),
empty: isHidden('[data-test-parent]'),
saveParents: clickable('[data-test-save]'),
cancelParents: clickable('[data-test-cancel]'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { clickable, create, collection, isHidden, isPresent } from 'ember-cli-pa

const definition = {
scope: '[data-test-objective-list-item-parents]',
list: collection('li', {
manage: clickable('[data-test-manage]'),
}),
list: collection('li'),
manage: clickable('[data-test-manage]'),
empty: isHidden('[data-test-parent]'),
saveParents: clickable('[data-test-save]'),
cancelParents: clickable('[data-test-cancel]'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,6 @@ module('Integration | Component | course/objective-list-item-parents', function
@isSaving={{false}}
@cancel={{(noop)}}
/>`);
await component.list[0].manage();
await component.manage();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module('Integration | Component | course/objective-list-item', function (hooks)
@manageParents={{this.manageParents}}
/>`,
);
await component.parents.list[0].manage();
await component.parents.manage();
assert.ok(component.parentManager.isPresent);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module('Integration | Component | course/objectives', function (hooks) {
'course objective 0',
);
assert.strictEqual(component.objectiveList.objectives[0].parents.list.length, 1);
await component.objectiveList.objectives[0].parents.list[0].manage();
await component.objectiveList.objectives[0].parents.manage();

const m = component.objectiveList.objectives[0].parentManager;
assert.notOk(m.hasMultipleCohorts);
Expand Down Expand Up @@ -173,7 +173,7 @@ module('Integration | Component | course/objectives', function (hooks) {
'course objective 0',
);
assert.strictEqual(component.objectiveList.objectives[0].parents.list.length, 1);
await component.objectiveList.objectives[0].parents.list[0].manage();
await component.objectiveList.objectives[0].parents.manage();

const m = component.objectiveList.objectives[0].parentManager;
assert.ok(m.hasMultipleCohorts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ module('Integration | Component | session/objective-list-item-parents', function
@isSaving={{false}}
@cancel={{(noop)}}
/>`);
await component.list[0].manage();
await component.manage();
});

test('parent objectives are correctly sorted', async function (assert) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module('Integration | Component | session/objective-list-item', function (hooks)
@session={{this.sessionModel}}
/>`,
);
await component.parents.list[0].manage();
await component.parents.manage();
assert.ok(component.parentManager.isPresent);
});

Expand Down

0 comments on commit 3765dca

Please sign in to comment.