Skip to content

Commit 1692711

Browse files
committed
refactor per review commet, add new cases
1 parent 0ed2bcd commit 1692711

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

dev/tests/js/jasmine/tests/app/code/Magento/Theme/view/frontend/web/js/cookie-status.test.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,25 @@ define([
2525
window.navigator = navigator;
2626
});
2727

28-
it('verify cookie-status initialization', function () {
28+
it('verify initialization cookieStatus widget', function () {
29+
expect($.fn.cookieStatus).toBeDefined();
30+
});
31+
32+
it('verify that modal does not shows when cookies are supported', function () {
33+
expect($.fn.cookieStatus).toBeDefined();
34+
window.navigator = {
35+
cookieEnabled: true
36+
};
37+
widget._init();
38+
expect($(document.body).html()).not.toContain('<aside role="dialog" class="modal-popup');
39+
});
40+
41+
it('shows the modal when cookies are not supported', function () {
2942
expect($.fn.cookieStatus).toBeDefined();
3043
window.navigator = {
3144
cookieEnabled: false
3245
};
3346
widget._init();
34-
expect($('.cookie-status').length).toBe(1);
3547
expect($(document.body).html()).toContain('<aside role="dialog" class="modal-popup');
3648
});
3749

0 commit comments

Comments
 (0)