diff --git a/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CompletionOptions/MasteryCriteriaGoal.vue b/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CompletionOptions/MasteryCriteriaGoal.vue index 84e6b5b0fb..d3e2f70676 100644 --- a/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CompletionOptions/MasteryCriteriaGoal.vue +++ b/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/CompletionOptions/MasteryCriteriaGoal.vue @@ -36,7 +36,10 @@ translateValidator, getInvalidText, } from 'shared/utils/validation'; - import MasteryModels, { MasteryModelsList } from 'shared/leUtils/MasteryModels'; + import MasteryModels, { + MasteryModelsList, + MasteryModelsNames, + } from 'shared/leUtils/MasteryModels'; import { constantsTranslationMixin } from 'shared/mixins'; import DropdownWrapper from 'shared/views/form/DropdownWrapper'; @@ -84,10 +87,13 @@ }, }, masteryCriteria() { - return MasteryModelsList.map(model => ({ - text: this.translateConstant(model), - value: model, - })); + // temporarily exclude pre/post test until the creation/editing UI is done + return MasteryModelsList.filter(model => model !== MasteryModelsNames.PRE_POST_TEST).map( + model => ({ + text: this.translateConstant(model), + value: model, + }), + ); }, masteryRules() { return this.required ? getMasteryModelValidators().map(translateValidator) : []; diff --git a/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/__tests__/masteryCriteriaGoal.spec.js b/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/__tests__/masteryCriteriaGoal.spec.js index 3c39caa45e..3567d8ce5c 100644 --- a/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/__tests__/masteryCriteriaGoal.spec.js +++ b/contentcuration/contentcuration/frontend/shared/views/contentNodeFields/__tests__/masteryCriteriaGoal.spec.js @@ -2,7 +2,7 @@ import { mount } from '@vue/test-utils'; import MasteryCriteriaGoal from '../CompletionOptions/MasteryCriteriaGoal'; import TestForm from 'shared/views/__tests__/TestForm'; import { constantStrings } from 'shared/mixins'; -import MasteryModels from 'shared/leUtils/MasteryModels'; +import MasteryModels, { MasteryModelsNames } from 'shared/leUtils/MasteryModels'; describe('MasteryCriteriaGoal', () => {}); async function makeWrapper(propsData = {}) { @@ -28,9 +28,15 @@ describe('masteryCriteriaGoal', () => { describe('on load', () => { MasteryModels.forEach(model => { - it(`${model} mastery option should be an option to select`, () => { - expect(wrapper.findComponent('.v-list').text()).toContain(constantStrings.$tr(model)); - }); + if (model === MasteryModelsNames.PRE_POST_TEST) { + it(`${model} mastery option should not be an option to select (not yet implemented)`, () => { + expect(wrapper.findComponent('.v-list').text()).not.toContain(constantStrings.$tr(model)); + }); + } else { + it(`${model} mastery option should be an option to select`, () => { + expect(wrapper.findComponent('.v-list').text()).toContain(constantStrings.$tr(model)); + }); + } }); it('should render according to masteryModel prop', async () => { for (const model of MasteryModels) {