Skip to content

Commit 00660e1

Browse files
authored
Merge pull request #5892 from marcellamaki/filter-prepost-mastery-goal
Since pre-post-test creation and editing is not implemented in studio…
2 parents d82db06 + 9899063 commit 00660e1

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CompletionOptions/MasteryCriteriaGoal.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
translateValidator,
3737
getInvalidText,
3838
} from 'shared/utils/validation';
39-
import MasteryModels, { MasteryModelsList } from 'shared/leUtils/MasteryModels';
39+
import MasteryModels, {
40+
MasteryModelsList,
41+
MasteryModelsNames,
42+
} from 'shared/leUtils/MasteryModels';
4043
import { constantsTranslationMixin } from 'shared/mixins';
4144
import DropdownWrapper from 'shared/views/form/DropdownWrapper';
4245
@@ -84,10 +87,13 @@
8487
},
8588
},
8689
masteryCriteria() {
87-
return MasteryModelsList.map(model => ({
88-
text: this.translateConstant(model),
89-
value: model,
90-
}));
90+
// temporarily exclude pre/post test until the creation/editing UI is done
91+
return MasteryModelsList.filter(model => model !== MasteryModelsNames.PRE_POST_TEST).map(
92+
model => ({
93+
text: this.translateConstant(model),
94+
value: model,
95+
}),
96+
);
9197
},
9298
masteryRules() {
9399
return this.required ? getMasteryModelValidators().map(translateValidator) : [];

contentcuration/contentcuration/frontend/shared/views/contentNodeFields/__tests__/masteryCriteriaGoal.spec.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { mount } from '@vue/test-utils';
22
import MasteryCriteriaGoal from '../CompletionOptions/MasteryCriteriaGoal';
33
import TestForm from 'shared/views/__tests__/TestForm';
44
import { constantStrings } from 'shared/mixins';
5-
import MasteryModels from 'shared/leUtils/MasteryModels';
5+
import MasteryModels, { MasteryModelsNames } from 'shared/leUtils/MasteryModels';
66

77
describe('MasteryCriteriaGoal', () => {});
88
async function makeWrapper(propsData = {}) {
@@ -28,9 +28,15 @@ describe('masteryCriteriaGoal', () => {
2828

2929
describe('on load', () => {
3030
MasteryModels.forEach(model => {
31-
it(`${model} mastery option should be an option to select`, () => {
32-
expect(wrapper.findComponent('.v-list').text()).toContain(constantStrings.$tr(model));
33-
});
31+
if (model === MasteryModelsNames.PRE_POST_TEST) {
32+
it(`${model} mastery option should not be an option to select (not yet implemented)`, () => {
33+
expect(wrapper.findComponent('.v-list').text()).not.toContain(constantStrings.$tr(model));
34+
});
35+
} else {
36+
it(`${model} mastery option should be an option to select`, () => {
37+
expect(wrapper.findComponent('.v-list').text()).toContain(constantStrings.$tr(model));
38+
});
39+
}
3440
});
3541
it('should render according to masteryModel prop', async () => {
3642
for (const model of MasteryModels) {

0 commit comments

Comments
 (0)