Skip to content

A platform for community discussion. Free, open, simple.

DEV: uses hasNoErrors for field as used on form (#29154)

Joffrey JAFFEUX9124d6ba5ae2
diff --git a/app/assets/javascripts/discourse/tests/helpers/form-kit-assertions.js b/app/assets/javascripts/discourse/tests/helpers/form-kit-assertions.js
index 7d6c3733414..1d02766f608 100644
--- a/app/assets/javascripts/discourse/tests/helpers/form-kit-assertions.js
+++ b/app/assets/javascripts/discourse/tests/helpers/form-kit-assertions.js
@@ -174,7 +174,7 @@ class FieldHelper {
.includesText(error, message);
}
- hasNoError(message) {
+ hasNoErrors(message) {
this.context
.dom(this.element.querySelector(".form-kit__errors"))
.doesNotExist(message);
diff --git a/app/assets/javascripts/discourse/tests/integration/components/form-kit/controls/input-number-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/form-kit/controls/input-number-test.gjs
index 5b645f1af1f..6f1480f18c6 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/form-kit/controls/input-number-test.gjs
+++ b/app/assets/javascripts/discourse/tests/integration/components/form-kit/controls/input-number-test.gjs
@@ -53,7 +53,7 @@ module(
await fillIn("input", "0");
await formKit().submit();
- assert.form().field("foo").hasNoError();
+ assert.form().field("foo").hasNoErrors();
});
}
);
diff --git a/app/assets/javascripts/discourse/tests/integration/components/form-kit/form-test.gjs b/app/assets/javascripts/discourse/tests/integration/components/form-kit/form-test.gjs
index d030dfc9cae..46b3480afb8 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/form-kit/form-test.gjs
+++ b/app/assets/javascripts/discourse/tests/integration/components/form-kit/form-test.gjs
@@ -83,7 +83,7 @@ module("Integration | Component | FormKit | Form", function (hooks) {
await formKit().field("foo").fillIn("");
- assert.form().field("foo").hasNoError();
+ assert.form().field("foo").hasNoErrors();
await formKit().submit();
@@ -96,7 +96,7 @@ module("Integration | Component | FormKit | Form", function (hooks) {
await formKit().field("foo").fillIn("t");
- assert.form().field("foo").hasNoError();
+ assert.form().field("foo").hasNoErrors();
assert.form().field("bar").hasError("Required");
assert.form().hasErrors({
bar: "Required",
@@ -187,7 +187,7 @@ module("Integration | Component | FormKit | Form", function (hooks) {
await formKit().reset();
- assert.form().field("foo").hasNoError("it resets the errors");
+ assert.form().field("foo").hasNoErrors("it resets the errors");
});
test("immutable by default", async function (assert) {