|
8 | 8 |
|
9 | 9 | define(['Magento_Bundle/js/components/bundle-dynamic-rows', 'uiRegistry', 'uiCollection'],
|
10 | 10 | function (BundleDynamicRows, registry, uiCollection) {
|
11 |
| - 'use strict'; |
| 11 | + 'use strict'; |
12 | 12 |
|
13 |
| - describe('Magento_Bundle/js/components/bundle-dynamic-rows', function () { |
14 |
| - let unit; |
| 13 | + describe('Magento_Bundle/js/components/bundle-dynamic-rows', function () { |
| 14 | + let unit; |
15 | 15 |
|
16 |
| - beforeEach(function () { |
17 |
| - unit = new BundleDynamicRows({ |
18 |
| - dataScope: 'bundle-dynamic-rows', |
19 |
| - label: 'Dynamic Rows', |
20 |
| - collapsibleHeader: true, |
21 |
| - columnsHeader: false, |
22 |
| - deleteProperty: false, |
23 |
| - addButton: false, |
24 |
| - name: 'dynamic', |
25 |
| - bundleSelectionsName: 'bundle_selections' |
| 16 | + beforeEach(function () { |
| 17 | + unit = new BundleDynamicRows({ |
| 18 | + dataScope: 'bundle-dynamic-rows', |
| 19 | + label: 'Dynamic Rows', |
| 20 | + collapsibleHeader: true, |
| 21 | + columnsHeader: false, |
| 22 | + deleteProperty: false, |
| 23 | + addButton: false, |
| 24 | + name: 'dynamic', |
| 25 | + bundleSelectionsName: 'bundle_selections' |
| 26 | + }); |
26 | 27 | });
|
27 |
| - }); |
28 | 28 |
|
29 |
| - describe ('test removeBundleItemsFromOption method', function () { |
30 |
| - it('Check if bundle items are removed from option', function () { |
31 |
| - let bundleSelections = new uiCollection; |
| 29 | + describe('test removeBundleItemsFromOption method', function () { |
| 30 | + it('Check if bundle items are removed from option', function () { |
| 31 | + let bundleSelections = new uiCollection; |
32 | 32 |
|
33 |
| - spyOn(bundleSelections, 'destroyChildren').and.callThrough(); |
34 |
| - spyOn(registry, 'get').and.returnValue(bundleSelections); |
35 |
| - spyOn(unit, 'removeBundleItemsFromOption').and.callThrough(); |
| 33 | + spyOn(bundleSelections, 'destroyChildren').and.callThrough(); |
| 34 | + spyOn(registry, 'get').and.returnValue(bundleSelections); |
| 35 | + spyOn(unit, 'removeBundleItemsFromOption').and.callThrough(); |
36 | 36 |
|
37 |
| - unit.removeBundleItemsFromOption(1); |
| 37 | + unit.removeBundleItemsFromOption(1); |
38 | 38 |
|
39 |
| - expect(registry.get).toHaveBeenCalledWith('dynamic.1.bundle_selections'); |
40 |
| - expect(bundleSelections.destroyChildren).toHaveBeenCalled(); |
| 39 | + expect(registry.get).toHaveBeenCalledWith('dynamic.1.bundle_selections'); |
| 40 | + expect(bundleSelections.destroyChildren).toHaveBeenCalled(); |
| 41 | + }); |
41 | 42 | });
|
42 | 43 | });
|
43 | 44 | });
|
44 |
| -}); |
0 commit comments