File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/js/location/core/test/entity/generic/fieldcollection.test.js
Back
import FieldCollection from "../../../src/entity/generic/fieldcollection"; import Field from "../../../src/entity/generic/field"; describe('FieldCollection', () => { it('Should be a function', () => { assert(typeof FieldCollection === 'function'); }); it('Should be constructed successfully', () => { let fields = new FieldCollection(); assert.ok(fields instanceof FieldCollection); fields = new FieldCollection({ fields: [ new Field({type: 222}) ] }); assert.ok(fields instanceof FieldCollection); }); describe('getField, setField', () => { let fields = new FieldCollection(); fields.setField(new Field({ type: 222 })); it('Should be instance of Field', () => { assert.ok(fields.getField(222) instanceof Field); }); it('Should return initial type', () => { assert.equal(fields.getField(222).type, 222); }); }); describe('isFieldExists', () => { let fields = new FieldCollection({ fields: [ new Field({type: 222}) ] }); it('Should return true', () => { assert.equal(fields.isFieldExists(222), true); }); it('Should return false', () => { assert.equal(fields.isFieldExists(333), false); }); }); });
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.28 |
proxy
|
phpinfo
|
Settings