Skip to content

Commit cda9372

Browse files
committed
MAGETWO-31592: Javascript Unit Test Framework Update
- Removed redundant test. Fixed typos.
1 parent 4da3271 commit cda9372

File tree

1 file changed

+7
-24
lines changed
  • dev/tests/js/spec/integration/Magento/PageCache/frontend/js

1 file changed

+7
-24
lines changed

dev/tests/js/spec/integration/Magento/PageCache/frontend/js/pageCache.js

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ define([
142142
expect($.fn.formKey).toBeDefined();
143143
});
144144

145-
it('widget set value to input[form_key]', function () {
145+
it('widget gets value of input[form_key]', function () {
146146
spyOn($.mage.cookies, 'get').and.returnValue('FAKE_COOKIE');
147147

148148
wdContainer.formKey({
@@ -153,7 +153,7 @@ define([
153153
expect(inputContainer.val()).toBe('FAKE_COOKIE');
154154
});
155155

156-
it('widget set value to input[form_key]', function () {
156+
it('widget sets value to input[form_key] in case it empty', function () {
157157
spyOn($.mage.cookies, 'set');
158158
spyOn($.mage.cookies, 'get');
159159

@@ -166,7 +166,7 @@ define([
166166
expect(inputContainer.val()).toEqual(jasmine.any(String));
167167
});
168168

169-
it('widget exist on load on body', function (done) {
169+
it('widget exists on load on body', function (done) {
170170
$(function () {
171171
expect($('body').data('mageFormKey')).toBeDefined();
172172
done();
@@ -204,7 +204,7 @@ define([
204204
expect($.fn.comments).not.toHaveBeenCalled();
205205
});
206206

207-
it('_searchPlaceholders called only when HTML_COMMENTS', function () {
207+
it('_searchPlaceholders is called only when HTML_COMMENTS', function () {
208208
var nodes;
209209
spyOn($.mage.cookies, 'get').and.returnValue('FAKE_VERSION_COOKIE');
210210
spyOn($.mage.pageCache.prototype, '_searchPlaceholders');
@@ -221,7 +221,7 @@ define([
221221
expect($.mage.pageCache.prototype._searchPlaceholders).toHaveBeenCalledWith(nodes);
222222
});
223223

224-
it('_searchPlaceholders return Array of blocks', function () {
224+
it('_searchPlaceholders returns Array of blocks', function () {
225225
var nodes,
226226
searches;
227227
spyOn($.mage.cookies, 'get').and.returnValue('FAKE_VERSION_COOKIE');
@@ -240,24 +240,7 @@ define([
240240
expect(searches[0].closeElement.nodeType).toBeDefined();
241241
});
242242

243-
it('_searchPlaceholders called only when HTML_COMMENTS', function () {
244-
var nodes;
245-
spyOn($.mage.cookies, 'get').and.returnValue('FAKE_VERSION_COOKIE');
246-
spyOn($.mage.pageCache.prototype, '_searchPlaceholders');
247-
248-
wdContainer
249-
.html('<!-- BLOCK FAKE_BLOCK -->FAKE_TEXT<!-- /BLOCK FAKE_BLOCK -->')
250-
.pageCache();
251-
252-
nodes = wdContainer.comments();
253-
expect(nodes.length).toEqual(2);
254-
255-
expect($.mage.cookies.get).toHaveBeenCalled();
256-
expect($.mage.pageCache.prototype._searchPlaceholders).toHaveBeenCalled();
257-
expect($.mage.pageCache.prototype._searchPlaceholders).toHaveBeenCalledWith(nodes);
258-
});
259-
260-
it('_replacePlaceholder append HTML after sibling node', function () {
243+
it('_replacePlaceholder appends HTML after sibling node', function () {
261244
var replacer,
262245
searcher,
263246
placeholders,
@@ -280,7 +263,7 @@ define([
280263
expect(wdContainer.html()).toEqual('<span></span><span>FAKE_HTML</span>');
281264
});
282265

283-
it('_replacePlaceholder prepend HTML if no sibling', function () {
266+
it('_replacePlaceholder prepends HTML if no sibling', function () {
284267
var replacer,
285268
searcher,
286269
placeholders,

0 commit comments

Comments
 (0)