/
githubmirror
/
oppia
Обзор
Документация
Войти
/
githubmirror
/
oppia
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
core/templates/domain/exploration/param-changes.model.spec.ts
56 строк
2 KB
Kartik Suryavanshi
Fix part of #10700:Migrated ParamChangesObjectFactory to param-changes.model and ParamSpecObjectFactory to param-spec.model (#22992)
11 авг 2025, 12:00
Не верифицирован
11 авг 2025, 12:00
2ddb223
Код
Авторство
О чём код?
// Copyright 2020 The Oppia Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Unit tests for ParamChanges model class. */ import {ParamChange} from './param-change.model'; import {ParamChanges} from 'domain/exploration/param-changes.model'; describe('ParamChanges', () => { const cArgs = { parse_with_jinja: true, value: '', }; const gId = 'Copier'; it('should create a ParamChange array from a list of dictionaries', () => { const paramName1 = 'param_1'; const paramName2 = 'param_2'; const backendList = [ { customization_args: cArgs, generator_id: gId, name: paramName1, }, { customization_args: cArgs, generator_id: gId, name: paramName2, }, ]; const testOutcome: ParamChange[] = ParamChanges.createFromBackendList(backendList); expect(testOutcome.length).toBe(2); expect(testOutcome[0].customizationArgs).toEqual(cArgs); expect(testOutcome[0].generatorId).toBe(gId); expect(testOutcome[0].name).toBe(paramName1); expect(testOutcome[1].customizationArgs).toEqual(cArgs); expect(testOutcome[1].generatorId).toBe(gId); expect(testOutcome[1].name).toBe(paramName2); }); });