@expressen/tallahassee
Advanced tools
Comparing version 14.11.0 to 14.12.0
@@ -53,2 +53,3 @@ "use strict"; | ||
const window = this.window = new Window(resp, { | ||
location: this.location, | ||
fetch: new Fetch(webPage.fetch.bind(webPage)), | ||
@@ -61,2 +62,3 @@ get document() { | ||
const self = this; | ||
Object.defineProperties(document, { | ||
@@ -73,2 +75,7 @@ defaultView: { | ||
}, | ||
_browser: { | ||
get() { | ||
return self; | ||
}, | ||
}, | ||
}); | ||
@@ -75,0 +82,0 @@ |
"use strict"; | ||
const { PointerEvent } = require("./Events.js"); | ||
const HTMLElement = require("./HTMLElement.js"); | ||
@@ -48,2 +49,19 @@ | ||
} | ||
async click() { | ||
const clickEvent = new PointerEvent("click", { bubbles: true }); | ||
this.dispatchEvent(clickEvent); | ||
if (clickEvent.defaultPrevented) { | ||
await Promise.all(this.ownerDocument.defaultView.fetch._pendingRequests); | ||
return this.ownerDocument._browser; | ||
} | ||
let uri; | ||
if (this.host === this.ownerDocument.location.host) { | ||
uri = `${this.pathname}${this.search}`; | ||
} else { | ||
uri = this.href; | ||
} | ||
return this.ownerDocument._browser.navigateTo(uri); | ||
} | ||
}; | ||
@@ -50,0 +68,0 @@ |
@@ -46,2 +46,7 @@ "use strict"; | ||
} | ||
click() { | ||
if (this.disabled) return; | ||
super.click(); | ||
} | ||
}; |
@@ -36,3 +36,2 @@ "use strict"; | ||
click() { | ||
if (this.disabled) return; | ||
if (this.nodeName === "SUMMARY") { | ||
@@ -39,0 +38,0 @@ this.closest("details").open = !this.closest("details").open; |
@@ -40,3 +40,3 @@ "use strict"; | ||
const webPageUrl = windowObjects.location ? windowObjects.location : resp.url; | ||
const location = this[locationSymbol] = new Location(this, webPageUrl); | ||
const location = this[locationSymbol] = windowObjects.location || new Location(this, webPageUrl); | ||
@@ -43,0 +43,0 @@ this[navigatorSymbol] = new Navigator(userAgent); |
{ | ||
"name": "@expressen/tallahassee", | ||
"version": "14.11.0", | ||
"version": "14.12.0", | ||
"description": "Lightweight client testing framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
127164
3891