![]() 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/timeline/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /* eslint-disable max-nested-callbacks */ define([ 'squire' ], function (Squire) { 'use strict'; var injector = new Squire(), mocks = { 'Magento_Ui/js/timeline/timeline-view': jasmine.createSpy() }, timeline; beforeEach(function (done) { injector.mock(mocks); injector.require(['Magento_Ui/js/timeline/timeline', 'knockoutjs/knockout-es5'], function (Constr) { timeline = new Constr({ name: '', index: '', links: '', listens: '', viewConfig: { component: '', model: '' }, dndConfig: { enabled: false } }); done(); }); }); afterEach(function () { try { injector.clean(); injector.remove(); } catch (e) {} }); describe('Magento_Ui/js/timeline/timeline', function () { describe('isActive method', function () { it('record status is 1', function () { expect(timeline.isActive({ status: 1 })).toBe(true); }); it('record status is "1"', function () { expect(timeline.isActive({ status: '1' })).toBe(true); }); it('record status is 2', function () { expect(timeline.isActive({ status: 2 })).toBe(false); }); }); describe('isUpcoming method', function () { it('record status is 2', function () { expect(timeline.isUpcoming({ status: 2 })).toBe(true); }); it('record status is "2"', function () { expect(timeline.isUpcoming({ status: '2' })).toBe(true); }); it('record status is 1', function () { expect(timeline.isUpcoming({ status: 1 })).toBe(false); }); }); }); });