Skip to content

Commit

Permalink
PM-11468: Add data-testids for View Item pages (#11043)
Browse files Browse the repository at this point in the history
* Add data test IDs for identity information.

* Add data test IDs for custom fields.
  • Loading branch information
alec-livefront authored Sep 16, 2024
1 parent d52ab5e commit 651f1e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ <h2 bitTypography="h6">{{ "customFields" | i18n }}</h2>
class="tw-border-secondary-300 [&_bit-form-field:last-of-type]:tw-mb-0"
*ngFor="let field of cipher.fields; let last = last"
[ngClass]="{ 'tw-mb-4': !last }"
data-testid="custom-field"
>
<bit-form-field *ngIf="field.type === fieldType.Text" [disableReadOnlyBorder]="last">
<bit-label>{{ field.name }}</bit-label>
Expand All @@ -19,6 +20,7 @@ <h2 bitTypography="h6">{{ "customFields" | i18n }}</h2>
showToast
[valueLabel]="field.name"
[appA11yTitle]="'copyValue' | i18n"
data-testid="copy-custom-field"
></button>
</bit-form-field>
<bit-form-field *ngIf="field.type === fieldType.Hidden" [disableReadOnlyBorder]="last">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ <h2 bitTypography="h6">{{ "personalDetails" | i18n }}</h2>
[appCopyClick]="cipher.identity.fullName"
showToast
[valueLabel]="'name' | i18n"
data-testid="copy-name"
></button>
</bit-form-field>
<bit-form-field *ngIf="cipher.identity.username">
Expand All @@ -41,6 +42,7 @@ <h2 bitTypography="h6">{{ "personalDetails" | i18n }}</h2>
[appCopyClick]="cipher.identity.company"
showToast
[valueLabel]="'company' | i18n"
data-testid="copy-company"
></button>
</bit-form-field>
</read-only-cipher-card>
Expand Down Expand Up @@ -70,6 +72,7 @@ <h2 bitTypography="h6">{{ "identification" | i18n }}</h2>
[appCopyClick]="cipher.identity.ssn"
showToast
[valueLabel]="'ssn' | i18n"
data-testid="copy-ssn"
></button>
</bit-form-field>
<bit-form-field *ngIf="cipher.identity.passportNumber">
Expand All @@ -96,6 +99,7 @@ <h2 bitTypography="h6">{{ "identification" | i18n }}</h2>
[appCopyClick]="cipher.identity.passportNumber"
showToast
[valueLabel]="'passportNumber' | i18n"
data-testid="copy-passport"
></button>
</bit-form-field>
<bit-form-field *ngIf="cipher.identity.licenseNumber">
Expand All @@ -109,6 +113,7 @@ <h2 bitTypography="h6">{{ "identification" | i18n }}</h2>
[appCopyClick]="cipher.identity.licenseNumber"
showToast
[valueLabel]="'licenseNumber' | i18n"
data-testid="copy-license"
></button>
</bit-form-field>
</read-only-cipher-card>
Expand All @@ -131,6 +136,7 @@ <h2 bitTypography="h6">{{ "contactInfo" | i18n }}</h2>
[appCopyClick]="cipher.identity.email"
showToast
[valueLabel]="'email' | i18n"
data-testid="copy-email"
></button>
</bit-form-field>
<bit-form-field *ngIf="cipher.identity.phone">
Expand All @@ -144,6 +150,7 @@ <h2 bitTypography="h6">{{ "contactInfo" | i18n }}</h2>
[appCopyClick]="cipher.identity.phone"
showToast
[valueLabel]="'phone' | i18n"
data-testid="copy-phone"
></button>
</bit-form-field>
<bit-form-field *ngIf="addressFields">
Expand All @@ -164,6 +171,7 @@ <h2 bitTypography="h6">{{ "contactInfo" | i18n }}</h2>
[appCopyClick]="addressFields"
showToast
[valueLabel]="'address' | i18n"
data-testid="copy-address"
></button>
</bit-form-field>
</read-only-cipher-card>
Expand Down

0 comments on commit 651f1e5

Please sign in to comment.