@justeat/f-footer
Advanced tools
Comparing version 1.45.0 to 1.46.0
@@ -6,3 +6,10 @@ # Changelog | ||
v1.46.0 | ||
------------------------------ | ||
*September 27, 2023* | ||
### Changed | ||
- Update "My account" link | ||
v1.45.0 | ||
@@ -9,0 +16,0 @@ ------------------------------ |
@@ -6,22 +6,14 @@ "use strict"; | ||
}); | ||
exports.resizeInit = exports.tabindexResize = exports.collapseFooterPanels = void 0; | ||
exports.tabindexResize = exports.resizeInit = exports.collapseFooterPanels = void 0; | ||
var _liteReady = _interopRequireDefault(require("lite-ready")); | ||
var _qwery = _interopRequireDefault(require("qwery")); | ||
var _fozzie = require("@justeat/fozzie"); | ||
var _lodash = _interopRequireDefault(require("lodash.debounce")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var footerPanels; | ||
var breakpoints = null; | ||
var tabindexResize = function tabindexResize() { | ||
var tabindexResize = exports.tabindexResize = function tabindexResize() { | ||
if (breakpoints === null) { | ||
breakpoints = (0, _fozzie.getBreakpoints)(); | ||
} | ||
if (window.matchMedia("(min-width: ".concat(breakpoints.wide, ")")).matches) { | ||
@@ -37,6 +29,3 @@ footerPanels.forEach(function (panel) { | ||
}; | ||
exports.tabindexResize = tabindexResize; | ||
var collapseFooterPanels = function collapseFooterPanels() { | ||
var collapseFooterPanels = exports.collapseFooterPanels = function collapseFooterPanels() { | ||
(0, _qwery.default)('[data-panel-collapsible]').forEach(function (panel) { | ||
@@ -46,6 +35,3 @@ panel.classList.add('is-collapsed'); | ||
}; | ||
exports.collapseFooterPanels = collapseFooterPanels; | ||
var resizeInit = function resizeInit() { | ||
var resizeInit = exports.resizeInit = function resizeInit() { | ||
window.addEventListener('resize', (0, _lodash.default)(tabindexResize, 100)); | ||
@@ -55,4 +41,2 @@ footerPanels = (0, _qwery.default)('[data-footer-panel-heading]'); | ||
}; | ||
exports.resizeInit = resizeInit; | ||
(0, _liteReady.default)(function () { | ||
@@ -59,0 +43,0 @@ collapseFooterPanels(); |
"use strict"; | ||
var _jsTestBuddy = _interopRequireDefault(require("js-test-buddy")); | ||
var _ = require(".."); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var shouldMatchMedia = function shouldMatchMedia() { | ||
@@ -19,3 +16,2 @@ var matches = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; | ||
}; | ||
describe('on page load', function () { | ||
@@ -25,11 +21,9 @@ it('footer panels are collapsed', function () { | ||
shouldMatchMedia(true); | ||
_jsTestBuddy.default.setBodyHtml("\n <div class=\"c-footer-panel\" data-panel-collapsible=\"\">\n <h2>\n Header text\n </h2>\n </div>\n "); | ||
_jsTestBuddy.default.setBodyHtml("\n <div class=\"c-footer-panel\" data-panel-collapsible=\"\">\n <h2>\n Header text\n </h2>\n </div>\n "); // Act | ||
// Act | ||
(0, _.collapseFooterPanels)(); | ||
var html = _jsTestBuddy.default.getBodyHtml(); | ||
var html = _jsTestBuddy.default.getBodyHtml(); // Assert | ||
// Assert | ||
expect(html).toMatchSnapshot(); | ||
@@ -43,10 +37,9 @@ }); | ||
// Arrange | ||
_jsTestBuddy.default.setBodyHtml("\n <div class=\"c-footer-panel\" data-panel-collapsible=\"\">\n <h2 data-footer-panel-heading tabindex=\"0\">\n Header text\n </h2>\n </div>\n "); // Act | ||
_jsTestBuddy.default.setBodyHtml("\n <div class=\"c-footer-panel\" data-panel-collapsible=\"\">\n <h2 data-footer-panel-heading tabindex=\"0\">\n Header text\n </h2>\n </div>\n "); | ||
// Act | ||
(0, _.resizeInit)(); | ||
var html = _jsTestBuddy.default.getBodyHtml(); | ||
var html = _jsTestBuddy.default.getBodyHtml(); // Assert | ||
// Assert | ||
expect(html).toMatchSnapshot(); | ||
@@ -56,10 +49,9 @@ }); | ||
// Arrange | ||
_jsTestBuddy.default.setBodyHtml("\n <div class=\"c-footer-panel\" data-panel-collapsible=\"\">\n <h2 data-footer-panel-heading>\n Header text\n </h2>\n </div>\n "); // Act | ||
_jsTestBuddy.default.setBodyHtml("\n <div class=\"c-footer-panel\" data-panel-collapsible=\"\">\n <h2 data-footer-panel-heading>\n Header text\n </h2>\n </div>\n "); | ||
// Act | ||
(0, _.resizeInit)(); | ||
var html = _jsTestBuddy.default.getBodyHtml(); | ||
var html = _jsTestBuddy.default.getBodyHtml(); // Assert | ||
// Assert | ||
expect(html).toMatchSnapshot(); | ||
@@ -74,10 +66,9 @@ }); | ||
// Arrange | ||
_jsTestBuddy.default.setBodyHtml("\n <div class=\"c-footer-panel\" data-panel-collapsible=\"\">\n <h2 data-footer-panel-heading tabindex=\"0\">\n Header text\n </h2>\n </div>\n "); // Act | ||
_jsTestBuddy.default.setBodyHtml("\n <div class=\"c-footer-panel\" data-panel-collapsible=\"\">\n <h2 data-footer-panel-heading tabindex=\"0\">\n Header text\n </h2>\n </div>\n "); | ||
// Act | ||
(0, _.resizeInit)(); | ||
var html = _jsTestBuddy.default.getBodyHtml(); | ||
var html = _jsTestBuddy.default.getBodyHtml(); // Assert | ||
// Assert | ||
expect(html).toMatchSnapshot(); | ||
@@ -84,0 +75,0 @@ }); |
{ | ||
"name": "@justeat/f-footer", | ||
"description": "Fozzie footer - Footer Component for Just Eat projects", | ||
"version": "1.45.0", | ||
"version": "1.46.0", | ||
"main": "dist/js/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
148301
3168
1