1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 13:23:34 +00:00

PM-11468: Add data-testids for View Item pages (#11043)

* Add data test IDs for identity information.

* Add data test IDs for custom fields.
This commit is contained in:
Alec Rippberger
2024-09-16 17:01:38 -05:00
committed by GitHub
parent d52ab5e343
commit 651f1e586a
2 changed files with 10 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
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>
@@ -19,6 +20,7 @@
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">

View File

@@ -15,6 +15,7 @@
[appCopyClick]="cipher.identity.fullName"
showToast
[valueLabel]="'name' | i18n"
data-testid="copy-name"
></button>
</bit-form-field>
<bit-form-field *ngIf="cipher.identity.username">
@@ -41,6 +42,7 @@
[appCopyClick]="cipher.identity.company"
showToast
[valueLabel]="'company' | i18n"
data-testid="copy-company"
></button>
</bit-form-field>
</read-only-cipher-card>
@@ -70,6 +72,7 @@
[appCopyClick]="cipher.identity.ssn"
showToast
[valueLabel]="'ssn' | i18n"
data-testid="copy-ssn"
></button>
</bit-form-field>
<bit-form-field *ngIf="cipher.identity.passportNumber">
@@ -96,6 +99,7 @@
[appCopyClick]="cipher.identity.passportNumber"
showToast
[valueLabel]="'passportNumber' | i18n"
data-testid="copy-passport"
></button>
</bit-form-field>
<bit-form-field *ngIf="cipher.identity.licenseNumber">
@@ -109,6 +113,7 @@
[appCopyClick]="cipher.identity.licenseNumber"
showToast
[valueLabel]="'licenseNumber' | i18n"
data-testid="copy-license"
></button>
</bit-form-field>
</read-only-cipher-card>
@@ -131,6 +136,7 @@
[appCopyClick]="cipher.identity.email"
showToast
[valueLabel]="'email' | i18n"
data-testid="copy-email"
></button>
</bit-form-field>
<bit-form-field *ngIf="cipher.identity.phone">
@@ -144,6 +150,7 @@
[appCopyClick]="cipher.identity.phone"
showToast
[valueLabel]="'phone' | i18n"
data-testid="copy-phone"
></button>
</bit-form-field>
<bit-form-field *ngIf="addressFields">
@@ -164,6 +171,7 @@
[appCopyClick]="addressFields"
showToast
[valueLabel]="'address' | i18n"
data-testid="copy-address"
></button>
</bit-form-field>
</read-only-cipher-card>