Prettier.

This commit is contained in:
Jesse Brault 2026-02-11 13:58:36 -06:00
parent be6660ab65
commit 51bdbbbb6a
2 changed files with 9 additions and 13 deletions

View File

@ -101,7 +101,11 @@
<p>Enter all as number of minutes, <em>eg.</em> 45</p>
<mat-form-field>
<mat-label>Preparation Time (minutes)</mat-label>
<input matInput [formControl]="recipeFormGroup.controls.preparationTime" data-test-role="preparation-time-input" />
<input
matInput
[formControl]="recipeFormGroup.controls.preparationTime"
data-test-role="preparation-time-input"
/>
@if (recipeFormGroup.controls.preparationTime.hasError("pattern")) {
<mat-error data-test-role="preparation-time-error">Must be a valid number.</mat-error>
}
@ -109,7 +113,7 @@
<mat-form-field>
<mat-label>Cooking Time (minutes)</mat-label>
<input matInput [formControl]="recipeFormGroup.controls.cookingTime" data-test-role="cooking-time-input"/>
<input matInput [formControl]="recipeFormGroup.controls.cookingTime" data-test-role="cooking-time-input" />
@if (recipeFormGroup.controls.cookingTime.hasError("pattern")) {
<mat-error data-test-role="cooking-time-error">Must be a valid number.</mat-error>
}

View File

@ -67,16 +67,10 @@ describe('EnterRecipeData', () => {
expect(component).toBeTruthy();
});
const testTimeInput = (
describeBlockName: string,
inputRole: string,
errorRole: string,
) => {
const testTimeInput = (describeBlockName: string, inputRole: string, errorRole: string) => {
describe(describeBlockName, () => {
it('should accept a number input with no error presented', () => {
const preparationTimeInputDebug = fixture.debugElement.query(
By.css(`[data-test-role=${inputRole}]`),
);
const preparationTimeInputDebug = fixture.debugElement.query(By.css(`[data-test-role=${inputRole}]`));
expect(preparationTimeInputDebug).toBeTruthy();
const preparationTimeInput: HTMLInputElement = preparationTimeInputDebug.nativeElement;
preparationTimeInput.value = '1234';
@ -107,9 +101,7 @@ describe('EnterRecipeData', () => {
fixture.detectChanges();
const errorDebug = fixture.debugElement.query(
By.css(`[data-test-role=${errorRole}]`),
);
const errorDebug = fixture.debugElement.query(By.css(`[data-test-role=${errorRole}]`));
expect(errorDebug).toBeTruthy();
expect(errorDebug.nativeElement.textContent).toContain('Must be a valid number.');
});