• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

duluca / lemon-mart / 9d2b344e-b0ca-437d-91b6-ada788fc64a1

28 Aug 2023 08:41PM UTC coverage: 58.491% (+5.9%) from 52.637%
9d2b344e-b0ca-437d-91b6-ada788fc64a1

push

circleci

web-flow
Merge pull request #90 from duluca/cypress-updates

update ci, rename stages, and cleanup

85 of 182 branches covered (0.0%)

Branch coverage included in aggregate %.

7 of 7 new or added lines in 4 files covered. (100.0%)

287 of 454 relevant lines covered (63.22%)

2.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/src/app/user/name-input/name-input.component.ts
1
import { Component, OnChanges, OnInit, SimpleChanges } from '@angular/core'
2
import { FormBuilder, FormGroup } from '@angular/forms'
3

4
import { BaseFormDirective } from '../../common/base-form.class'
5
import { OneCharValidation, RequiredTextValidation } from '../../common/validations'
6
import { ErrorSets } from '../../user-controls/field-error/field-error.directive'
7
import { IName } from '../user/user'
8

9
@Component({
10
  selector: 'app-name-input',
11
  // prettier-ignore
12
  template: `
13
    <form [formGroup]="formGroup">
14
      <div fxLayout="row" fxLayout.lt-sm="column" fxLayoutGap="10px">
15
        <mat-form-field appearance="outline" fxFlex="40%">
16
          <mat-label>First Name</mat-label>
17
          <input matInput aria-label="First Name" formControlName="first" #first />
18
          <mat-error [input]="first" [group]="formGroup"
19
                     [appFieldError]="ErrorSets['RequiredText']">
20
          </mat-error>
21
        </mat-form-field>
22
        <mat-form-field appearance="outline" fxFlex="20%">
23
          <mat-label>MI</mat-label>
24
          <input matInput aria-label="Middle Initial" formControlName="middle" #mi/>
25
          <mat-error [input]="mi" [group]="formGroup"
26
                     [appFieldError]="{error: 'invalid', message: 'Only initial'}">
27
          </mat-error>
28
        </mat-form-field>
29
        <mat-form-field appearance="outline" fxFlex="40%">
30
          <mat-label>Last Name</mat-label>
31
          <input matInput aria-label="Last Name" formControlName="last" #last />
32
          <mat-error [input]="last" [group]="formGroup"
33
                     [appFieldError]="ErrorSets['RequiredText']">
34
          </mat-error>
35
        </mat-form-field>
36
      </div>
37
    </form>
38
  `,
39
  styles: [
40
    `
41
      .mat-mdc-form-field {
42
        padding-top: 16px;
43
      }
44
    `,
45
  ],
46
})
47
export class NameInputComponent
1✔
48
  extends BaseFormDirective<IName>
49
  implements OnInit, OnChanges
50
{
51
  ErrorSets = ErrorSets
2✔
52

53
  constructor(private formBuilder: FormBuilder) {
2✔
54
    super()
2✔
55
  }
56

57
  ngOnInit() {
58
    this.formGroup = this.buildForm(this.initialData)
2✔
59

60
    if (this.disable) {
2!
61
      this.formGroup.disable()
×
62
    }
63

64
    this.formReady.emit(this.formGroup)
2✔
65
  }
66

67
  buildForm(initialData?: IName | null): FormGroup {
68
    const name = initialData
2✔
69
    return this.formBuilder.group({
2✔
70
      first: [name?.first || '', RequiredTextValidation],
4✔
71
      middle: [name?.middle || '', OneCharValidation],
4✔
72
      last: [name?.last || '', RequiredTextValidation],
4✔
73
    })
74
  }
75

76
  ngOnChanges(changes: SimpleChanges) {
77
    this.patchUpdatedDataIfChanged(changes)
1✔
78
  }
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc