Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"jquery-jcrop": "^0.9.13",
"luxon": "^1.27.0",
"masonry-layout": "^4.2.2",
"moment": "^2.29.2",
"moment": "^2.29.3",
"moment-timezone": "^0.5.34",
"photoswipe": "^4.1.3",
"pikaday": "^1.8.0",
"promise-polyfill": "^8.2.3",
"screenfull": "^6.0.1",
"select2": "^3.5.1",
"showdown": "^2.0.3",
"showdown": "^2.1.0",
"showdown-prettify": "^1.3.0",
"slick-carousel": "^1.8.1",
"slides": "git+https://github.com/Patternslib/slides.git",
Expand All @@ -38,19 +38,19 @@
"whatwg-fetch": "^3.4.0"
},
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/core": "^7.17.10",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
"@babel/preset-env": "^7.16.11",
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@babel/preset-env": "^7.17.10",
"@commitlint/cli": "^16.2.4",
"@commitlint/config-conventional": "^16.2.4",
"@release-it/conventional-changelog": "^4.3.0",
"@testing-library/jest-dom": "^5.16.4",
"babel-loader": "^8.2.4",
"babel-loader": "^8.2.5",
"copy-webpack-plugin": "^10.2.4",
"core-js": "3.22.0",
"core-js": "3.22.5",
"css-loader": "^6.7.1",
"eslint": "^8.13.0",
"eslint": "^8.15.0",
"eslint-config-prettier": "^8.5.0",
"expose-loader": "^3.0.0",
"husky": "^7.0.4",
Expand All @@ -59,19 +59,19 @@
"inspectpack": "^4.7.1",
"jest": "^27.5.1",
"jest-raw-loader": "^1.0.1",
"jest-watch-typeahead": "^1.0.0",
"jest-watch-typeahead": "^1.1.0",
"prettier": "^2.6.2",
"regenerator-runtime": "^0.13.9",
"release-it": "^14.14.2",
"sass": "^1.50.0",
"sass": "^1.51.0",
"sass-loader": "^12.6.0",
"style-loader": "^3.3.0",
"terser-webpack-plugin": "^5.3.1",
"timezone-mock": "^1.3.1",
"webpack": "^5.72.0",
"webpack": "^5.72.1",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.8.1",
"webpack-dev-server": "^4.9.0",
"webpack-modernizr-loader": "^5.0.0",
"whybundled": "^2.0.0",
"yarn": "^1.22.18"
Expand Down
2 changes: 1 addition & 1 deletion src/pat/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default Base.extend({
if (lang !== "en") {
const locale = await import(`@fullcalendar/core/locales/${lang}.js`);
config.locale = locale.default;
console.log("loaded cal locale for " + lang);
log.debug(`Loaded locale for ${lang}`);
}
if (this.options.first.day !== null) {
config.firstDay = this.options.first.day;
Expand Down
2 changes: 1 addition & 1 deletion src/pat/date-picker/date-picker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ describe("pat-date-picker", function () {

it("works with pat-autosubmit", async () => {
document.body.innerHTML = `
<form class="pat-autosubmit">
<form class="pat-autosubmit" onsubmit="return false;">
<input name="date" type="date" class="pat-date-picker"/>
</form>
`;
Expand Down
8 changes: 4 additions & 4 deletions src/pat/subform/subform.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("subform base tests", function () {
describe("Triggering of the pattern", function () {
it("happens when a fieldset has the pat-subform class", function () {
var $form = $(
"<form>" +
'<form onsubmit="return false;">' +
' <fieldset class="pat-subform">' +
' <input type="text" name="q" placeholder="Search query"/>' +
" </fieldset>" +
Expand All @@ -22,7 +22,7 @@ describe("subform base tests", function () {
describe("Entering a return", function () {
it("does nothing if the pat-autosubmit class is missing", function () {
var $form = $(
"<form>" +
'<form onsubmit="return false;">' +
' <fieldset class="pat-subform">' +
' <input type="text" name="q" placeholder="Search query"/>' +
" </fieldset>" +
Expand All @@ -41,7 +41,7 @@ describe("subform base tests", function () {
});
it("submits the subform when the pat-autosubmit class is present", function () {
var $form = $(
"<form>" +
'<form onsubmit="return false;">' +
' <fieldset class="pat-subform pat-autosubmit">' +
' <input type="text" name="q" placeholder="Search query"/>' +
" </fieldset>" +
Expand All @@ -60,7 +60,7 @@ describe("subform base tests", function () {
});
it("does not submit the parent autosubmit form when the pat-autosubmit class is present on both", function () {
var $form = $(
'<form class="pat-autosubmit">' +
'<form class="pat-autosubmit" onsubmit="return false;">' +
' <fieldset class="pat-subform pat-autosubmit">' +
' <input type="text" name="q" placeholder="Search query"/>' +
" </fieldset>" +
Expand Down
2 changes: 1 addition & 1 deletion src/pat/validation/validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ describe("pat-validation", function () {
// Buttons with ``formnovalidate`` should prevent validation.

document.body.innerHTML = `
<form class="pat-validation">
<form class="pat-validation" onsubmit="return false;">
<input name="ok" required />
<button formnovalidate>submit</button>
</form>
Expand Down
36 changes: 17 additions & 19 deletions src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "core-js/stable";
import "regenerator-runtime/runtime";

import jquery from "jquery";
global["$"] = global["jQuery"] = jquery;
global.$ = global.jQuery = jquery;

jquery.expr.pseudos.visible = function () {
// Fix jQuery ":visible" selector always returns false in JSDOM.
Expand All @@ -25,21 +25,17 @@ document.fullscreenEnabled = jest.fn();
document.fullscreenchange = jest.fn();
document.fullscreenerror = jest.fn();

// pat-subform
// See https://github.com/jsdom/jsdom/issues/1937#issuecomment-461810980
global["HTMLFormElement"].prototype.submit = () => {};

// resize-observer
global["ResizeObserver"] = function () {
global.ResizeObserver = function () {
// Just do nothing for now...
return { observe: () => {} };
};

global.IntersectionObserver = class IntersectionObserver {
constructor(callback) {
this.callback = callback;
if (! global.__patternslib_test_intersection_observers) {
global.__patternslib_test_intersection_observers = [];
if (!global.__patternslib_test_intersection_observers) {
global.__patternslib_test_intersection_observers = [];
}
this._el = null;
this._do_observe = false;
Expand All @@ -58,19 +54,21 @@ global.IntersectionObserver = class IntersectionObserver {
this._do_observe = false;
}
takeRecords() {}
_set_entry(is_intersecting=true) {
if (! this._do_observe) {
_set_entry(is_intersecting = true) {
if (!this._do_observe) {
return;
}
this.callback([{
isIntersecting: is_intersecting,
target: this._el,
// entry.boundingClientRect
// entry.intersectionRatio
// entry.intersectionRect
// entry.rootBounds
// entry.time
}])
this.callback([
{
isIntersecting: is_intersecting,
target: this._el,
// entry.boundingClientRect
// entry.intersectionRatio
// entry.intersectionRect
// entry.rootBounds
// entry.time
},
]);
this._cnt++;
}
};
Expand Down
Loading