mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: uses hasNoErrors for field as used on form (#29154)
This commit simply ensures the API is similar for fields and form.
This commit is contained in:
@@ -174,7 +174,7 @@ class FieldHelper {
|
||||
.includesText(error, message);
|
||||
}
|
||||
|
||||
hasNoError(message) {
|
||||
hasNoErrors(message) {
|
||||
this.context
|
||||
.dom(this.element.querySelector(".form-kit__errors"))
|
||||
.doesNotExist(message);
|
||||
|
||||
@@ -53,7 +53,7 @@ module(
|
||||
|
||||
await fillIn("input", "0");
|
||||
await formKit().submit();
|
||||
assert.form().field("foo").hasNoError();
|
||||
assert.form().field("foo").hasNoErrors();
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user