![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/form/components/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ define([ 'underscore', 'uiRegistry', 'Magento_Ui/js/form/components/tab' ], function (_, registry, Constr) { 'use strict'; describe('Magento_Ui/js/form/components/tab', function () { var obj = new Constr({ provider: 'provName', name: '', index: '' }); window.FORM_KEY = 'magentoFormKey'; registry.set('provName', { /** Stub */ on: function () {}, /** Stub */ get: function () {}, /** Stub */ set: function () {} }); describe('"initObservable" method', function () { it('Check for defined ', function () { expect(obj.hasOwnProperty('initObservable')).toBeDefined(); }); it('Check method type', function () { var type = typeof obj.initObservable; expect(type).toEqual('function'); }); it('Check returned value if method called without arguments', function () { expect(obj.initObservable()).toBeDefined(); }); it('Check returned value type if method called without arguments', function () { var type = typeof obj.initObservable(); expect(type).toEqual('object'); }); it('Check called "this.observe" method', function () { obj.observe = jasmine.createSpy().and.callFake(function () { return obj; }); obj.initObservable(); expect(obj.observe).toHaveBeenCalled(); }); }); describe('"activate" method', function () { it('Check for defined ', function () { expect(obj.hasOwnProperty('activate')).toBeDefined(); }); it('Check method type', function () { var type = typeof obj.activate; expect(type).toEqual('function'); }); it('Check called "this.setUnique" inner activate method', function () { obj.setUnique = jasmine.createSpy().and.callFake(function () { return obj; }); obj.activate(); expect(obj.setUnique).toHaveBeenCalled(); }); it('Check observable variable "active" after execution activate method', function () { obj.activate(); expect(obj.active()).toEqual(true); }); it('Check observable variable "wasActivated" after execution activate method', function () { obj.activate(); expect(obj.wasActivated()).toEqual(true); }); }); }); });