mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 02:12:26 +00:00
Merge pull request #1217 from PR0M3TH3AN/fix-popover-tests-jsdom-ref-3613247743198183095
Fix popover engine unit tests for JSDOM compatibility
This commit is contained in:
1 file changed
+3
-1
@@ -64,6 +64,7 @@ beforeEach(async () => {
|
||||
global.window = windowRef;
|
||||
global.document = documentRef;
|
||||
global.HTMLElement = windowRef.HTMLElement;
|
||||
global.HTMLStyleElement = windowRef.HTMLStyleElement;
|
||||
global.Element = windowRef.Element;
|
||||
global.Node = windowRef.Node;
|
||||
global.getComputedStyle = windowRef.getComputedStyle.bind(windowRef);
|
||||
@@ -103,6 +104,7 @@ afterEach(() => {
|
||||
delete global.window;
|
||||
delete global.document;
|
||||
delete global.HTMLElement;
|
||||
delete global.HTMLStyleElement;
|
||||
delete global.Element;
|
||||
delete global.Node;
|
||||
delete global.getComputedStyle;
|
||||
@@ -756,7 +758,7 @@ test("applies token-based sizing and arrow positioning", async () => {
|
||||
assert.equal(panelStyles.getPropertyValue("--popover-max-height").trim(), "240px");
|
||||
assert.equal(arrow.dataset.popoverArrowSide, "bottom");
|
||||
const arrowStyles = getComputedStyle(arrow);
|
||||
assert.notEqual(arrowStyles.top, "");
|
||||
assert.notEqual(arrowStyles.getPropertyValue("--popover-arrow-top").trim(), "auto");
|
||||
|
||||
popover.destroy();
|
||||
});
|
||||
Reference in new issue
Block a user