Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(components/forms): improve form error documentation #2007

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { SkyStatusIndicatorModule } from '@skyux/indicators';
import { SKY_FORM_ERRORS_ENABLED } from './form-errors-enabled-token';

/**
* Displays default and custom input error messages for SKY UX form components.
* Displays default and custom form field error messages for form field components.
* Set `labelText` on the form field component to automatically display required,
* maximum length, minimum length, date, email, phone number, time, and URL errors.
* To display custom errors, include sky-form-error elements in the form field component.
*/
@Component({
selector: 'sky-form-error',
Expand Down
11 changes: 5 additions & 6 deletions libs/components/forms/testing/src/input-box/input-box-harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,35 +112,35 @@ export class SkyInputBoxHarness extends SkyComponentHarness {
return (await this.#getFormError()).hasError('minlength');
}

/*
/**
* Whether the field is set to an invalid email address.
*/
public async hasEmailError(): Promise<boolean> {
return (await this.#getFormError()).hasError('email');
}

/*
/**
* Whether the field is set to an invalid URL.
*/
public async hasUrlError(): Promise<boolean> {
return (await this.#getFormError()).hasError('url');
}

/*
/**
* Whether the field is set to an invalid date.
*/
public async hasDateError(): Promise<boolean> {
return (await this.#getFormError()).hasError('date');
}

/*
/**
* Whether the field is set to an invalid phone number.
*/
public async hasPhoneFieldError(): Promise<boolean> {
return (await this.#getFormError()).hasError('phone');
}

/*
/**
* Whether the field is set to an invalid time.
*/
public async hasTimeError(): Promise<boolean> {
Expand Down Expand Up @@ -194,7 +194,6 @@ export class SkyInputBoxHarness extends SkyComponentHarness {

/**
* Indicates whether the input box has stacked styles applied.
* @returns
*/
public async getStacked(): Promise<boolean> {
const host = await this.host();
Expand Down
Loading