mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-25 17:25:16 +03:00
Notes: - The Power & Battery (2), OSD, and CLI tabs have been updated accordingly - HTML default control behavior was used whereever possible - HTML indent for the dialog tag is deliberately off to minimize diff noise in GitHub - Layout is not 100% identical, but spiratually the same - in most cases no changes were needed - OSD’s Font Manager dialog didn’t transition cleanly, so includes some slight restyling - OSD Font Manager previously had a green background/color for the graphic - that “just works” now - Specific cleanup (i.e., calling destroy()) does not seem necessary and was removed - Removal of jBox from setup.js and global scope seems not to affect jBox tooltips - Replacement of single quotes with double in main.js was done automatically by Prettier
23 lines
636 B
JavaScript
23 lines
636 B
JavaScript
import { JSDOM } from "jsdom";
|
|
import $ from "jquery";
|
|
import { vi } from "vitest";
|
|
|
|
// Note: this can go away once jquery is used as module everywhere
|
|
const { window } = new JSDOM("");
|
|
$(window);
|
|
globalThis.$ = $;
|
|
globalThis.jQuery = $;
|
|
|
|
Object.defineProperty(window, "matchMedia", {
|
|
writable: true,
|
|
value: vi.fn().mockImplementation((query) => ({
|
|
matches: false,
|
|
media: query,
|
|
onchange: null,
|
|
addListener: vi.fn(), // deprecated
|
|
removeListener: vi.fn(), // deprecated
|
|
addEventListener: vi.fn(),
|
|
removeEventListener: vi.fn(),
|
|
dispatchEvent: vi.fn(),
|
|
})),
|
|
});
|