Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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) : [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}) {
Expand All @@ -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) {
Expand Down
Loading