Skip to content

Commit abc8006

Browse files
committed
Cover changes with jasmnine test
1 parent ad7ad75 commit abc8006

File tree

1 file changed

+38
-0
lines changed
  • dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/frontend/js

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'Magento_ConfigurableProduct/js/configurable'
9+
], function ($, Configurable) {
10+
'use strict';
11+
12+
var widget;
13+
14+
beforeEach(function () {
15+
widget = new Configurable();
16+
widget.options = {
17+
spConfig: {
18+
attributes:
19+
{
20+
'size': {
21+
options: $('<div><p class="2"></p></div>')
22+
}
23+
}
24+
},
25+
values: {
26+
}
27+
};
28+
});
29+
30+
describe('Magento_ConfigurableProduct/js/configurable', function () {
31+
32+
it('check if attribute value is possible to be set as configurable option', function () {
33+
expect($.mage.configurable).toBeDefined();
34+
widget._parseQueryParams('http://magento.com/product?color=red&size=2');
35+
expect(widget.options.values.size).toBe('2');
36+
});
37+
});
38+
});

0 commit comments

Comments
 (0)