Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@expressen/tallahassee

Package Overview
Dependencies
Maintainers
12
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expressen/tallahassee - npm Package Compare versions

Comparing version 13.0.0 to 13.1.0

8

CHANGELOG.md

@@ -6,5 +6,11 @@ Changelog

## 13.1.0
- implement form novalidate
- add submit submitter with name to payload
- button has default type submit
## 13.0.0
- `input.validate` is of type ValidationState
- `input.validity` is of type `ValidityState`
- `<input name="foo" required oninput="setCustomValidity('')" oninvalid="setCustomValidity('Required')">` now executes attribute event handlers

@@ -11,0 +17,0 @@

10

lib/BrowserTab.js

@@ -173,5 +173,5 @@ "use strict";

const form = event.target;
const {target: form, submitter} = event;
const method = form.getAttribute("method") || "GET";
const formaction = (event.submitter?.getAttribute("formaction")) || form.getAttribute("action");
const formaction = (submitter?.getAttribute("formaction")) || form.getAttribute("action");
const action = formaction || this.window.location.pathname + (this.window.location.search ? this.window.location.search : "");

@@ -186,4 +186,8 @@

}
if (submitter?.name) uri.searchParams.append(submitter.name, submitter.value || "");
return callback(webPage.submit(`${uri.pathname}${uri.search}`));
} else if (method.toUpperCase() === "POST") {
const payload = new URLSearchParams(new FormData(form));
if (submitter?.name) payload.append(submitter.name, submitter.value || "");
const navigation = webPage.submit(action, {

@@ -194,3 +198,3 @@ method: "POST",

},
body: new URLSearchParams(new FormData(form)).toString(),
body: payload.toString(),
});

@@ -197,0 +201,0 @@ return callback(navigation);

@@ -23,2 +23,13 @@ "use strict";

}
get type() {
const type = this.getAttribute("type");
switch (type) {
case "submit":
case "reset":
case "button":
return type;
default:
return "submit";
}
}
click() {

@@ -25,0 +36,0 @@ if (this.disabled) return;

@@ -56,2 +56,12 @@ "use strict";

}
get noValidate() {
return this.hasAttribute("novalidate");
}
set noValidate(val) {
if (val) {
return this.setAttribute("novalidate", "novalidate");
} else {
return this.removeAttribute("novalidate");
}
}
get action() {

@@ -69,4 +79,4 @@ return this.getAttribute("action") || this[originSymbol];

if (target.type === "submit" || (target.tagName === "BUTTON" && !target.type)) {
if (!this.reportValidity()) return;
if (target.type === "submit") {
if (!this.noValidate && !this.reportValidity()) return;
const submitEvent = new SubmitEvent("submit");

@@ -73,0 +83,0 @@ submitEvent[symbols.submitter] = event.target;

{
"name": "@expressen/tallahassee",
"version": "13.0.0",
"version": "13.1.0",
"description": "Lightweight client testing framework",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc