Skip to content

Commit 1430cd5

Browse files
SHENGXING LUSHENGXING LU
authored andcommitted
QA tags
1 parent f26db44 commit 1430cd5

27 files changed

Lines changed: 100 additions & 95 deletions

File tree

src/app/pages/admin/categories/categories.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ <h2 class="text-2xl font-bold mb-4 dark:text-white">{{ 'CATEGORIES._categories'
77
</div>
88

99
<div class="flex flex-row w-full justify-end">
10-
<button type="button" (click)="createCategory()" class="ml-2 mr-8 mb-4 text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center align-middle me-2">
10+
<button data-cy="adminAddNewCategory" type="button" (click)="createCategory()" class="ml-2 mr-8 mb-4 text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center align-middle me-2">
1111
<p class="pl-2 pr-2 dark:text-white">{{ 'CATEGORIES._add_new_cat' | translate }}</p>
1212
<svg class="w-[18px] h-[18px] text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
1313
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14m-7 7V5"/>
1414
</svg>
15-
</button>
15+
</button>
1616
</div>
1717

1818
</div>
@@ -112,10 +112,10 @@ <h6 class="mb-3 text-sm font-medium text-gray-900 dark:text-white">
112112
<tbody>
113113
@for (cat of categories; track cat.id;let idx = $index) {
114114
<tr class="flex border-b dark:border-gray-700 hover:bg-gray-200 w-full justify-between dark:bg-secondary-300 dark:hover:bg-secondary-200">
115-
<td class="flex px-6 py-4 w-2/4">
115+
<td data-cy="adminTableOfferName" class="flex px-6 py-4 w-2/4">
116116
<b>{{cat.name}}</b>
117117
</td>
118-
<td class="hidden md:flex px-6 py-4 w-fit">
118+
<td data-cy="adminTableOfferStatus" class="hidden md:flex px-6 py-4 w-fit">
119119
@if(cat.lifecycleStatus == 'Active'){
120120
<span class="bg-blue-100 max-h-6 dark:bg-secondary-300 text-blue-600 text-xs font-medium me-2 px-2.5 py-0.5 rounded border border-blue-400">{{cat.lifecycleStatus}}</span>
121121
} @else if(cat.lifecycleStatus == 'Launched') {
@@ -129,8 +129,8 @@ <h6 class="mb-3 text-sm font-medium text-gray-900 dark:text-white">
129129
<td class="hidden md:table-cell px-6 py-4 w-fit">
130130
{{cat.lastUpdate | date:'EEEE, dd/MM/yy, HH:mm'}}
131131
</td>
132-
<td class="flex px-6 py-4 w-fit justify-end">
133-
<button type="button" (click)="goToUpdate(cat)" class="text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center me-2">
132+
<td class="flex px-6 py-4 w-fit justify-end">
133+
<button data-cy="adminEditCategory" type="button" (click)="goToUpdate(cat)" class="text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center me-2">
134134
<svg class="w-[18px] h-[18px] text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
135135
<path fill-rule="evenodd" d="M14 4.182A4.136 4.136 0 0 1 16.9 3c1.087 0 2.13.425 2.899 1.182A4.01 4.01 0 0 1 21 7.037c0 1.068-.43 2.092-1.194 2.849L18.5 11.214l-5.8-5.71 1.287-1.31.012-.012Zm-2.717 2.763L6.186 12.13l2.175 2.141 5.063-5.218-2.141-2.108Zm-6.25 6.886-1.98 5.849a.992.992 0 0 0 .245 1.026 1.03 1.03 0 0 0 1.043.242L10.282 19l-5.25-5.168Zm6.954 4.01 5.096-5.186-2.218-2.183-5.063 5.218 2.185 2.15Z" clip-rule="evenodd"/>
136136
</svg>

src/app/pages/admin/categories/create-category/create-category.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2 class="text-3xl font-bold text-primary-100 ml-4 dark:text-white">{{ 'CREATE_
6666
<app-markdown-textarea formControlName="description"></app-markdown-textarea>
6767
<label class="font-bold text-lg dark:text-white">{{ 'CREATE_CATEGORIES._choose_parent' | translate }}</label>
6868
<label class="inline-flex items-center me-5 cursor-pointer ml-4">
69-
<input type="checkbox" (change)="toggleParent()" [checked]="parentSelectionCheck" class="sr-only peer">
69+
<input data-cy="adminToggleParentCategory" type="checkbox" (change)="toggleParent()" [checked]="parentSelectionCheck" class="sr-only peer">
7070
<div class="relative w-11 h-6 bg-gray-400 dark:bg-gray-700 rounded-full peer peer-focus:ring-4 peer-focus:ring-primary-100 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary-100"></div>
7171
</label>
7272
@if(parentSelectionCheck){
@@ -128,7 +128,7 @@ <h2 class="text-3xl font-bold text-primary-100 ml-4 dark:text-white">{{ 'CREATE_
128128

129129
</form>
130130
<div class="flex w-full justify-items-end justify-end">
131-
<button type="button" (click)="showFinish();generalDone=true;" [disabled]="!generalForm.valid || (parentSelectionCheck == true && selectedCategory==undefined)" [ngClass]="!generalForm.valid || (parentSelectionCheck == true && selectedCategory==undefined) ? 'opacity-50' : 'hover:bg-primary-50'" class="flex text-white justify-end bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
131+
<button data-cy="adminCategoryNext" type="button" (click)="showFinish();generalDone=true;" [disabled]="!generalForm.valid || (parentSelectionCheck == true && selectedCategory==undefined)" [ngClass]="!generalForm.valid || (parentSelectionCheck == true && selectedCategory==undefined) ? 'opacity-50' : 'hover:bg-primary-50'" class="flex text-white justify-end bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
132132
{{ 'CREATE_CATEGORIES._next' | translate }}
133133
<svg class="rtl:rotate-180 w-3.5 h-3.5 ms-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
134134
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
@@ -176,7 +176,7 @@ <h2 class="text-3xl font-bold text-primary-100 ml-4 dark:text-white">{{ 'CREATE_
176176

177177

178178
<div class="flex w-full justify-items-end justify-end ml-4">
179-
<button type="button" (click)="createCategory();" class="flex text-white justify-end bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
179+
<button data-cy="adminCreateCategory" type="button" (click)="createCategory();" class="flex text-white justify-end bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
180180
{{ 'CREATE_CATEGORIES._create' | translate }}
181181
<svg class="rtl:rotate-180 w-3.5 h-3.5 ms-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
182182
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>

src/app/pages/admin/verification/verification.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ <h2 class="text-3xl font-bold text-primary-100 ml-4 dark:text-white">{{ 'ADMIN._
3838
class="mb-2 bg-gray-50 dark:bg-secondary-300 border border-gray-300 dark:border-secondary-200 dark:text-white text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5" />
3939

4040
<label for="vc" class="font-bold text-lg dark:text-white">{{ 'ADMIN._vc' | translate }}</label>
41-
<textarea formControlName="vc" rows="8" class="block w-full min-h-fit px-0 text-sm text-gray-800 dark:text-gray-200 bg-white dark:bg-secondary-300 border-0" placeholder="Add credential..." ></textarea>
41+
<textarea data-cy="adminVerifiableCredential" formControlName="vc" rows="8" class="block w-full min-h-fit px-0 text-sm text-gray-800 dark:text-gray-200 bg-white dark:bg-secondary-300 border-0" placeholder="Add credential..." ></textarea>
4242
</form>
4343

4444
<div class="flex w-full justify-items-end justify-end ml-4">
45-
<button type="button" (click)="verifyCredential();" class="flex text-white justify-end bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
45+
<button data-cy="adminAddCredential" type="button" (click)="verifyCredential();" class="flex text-white justify-end bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center inline-flex items-center">
4646
{{ 'ADMIN._add' | translate }}
4747
<svg class="rtl:rotate-180 w-3.5 h-3.5 ms-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
4848
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>

src/app/pages/catalogs/catalogs.component.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="container mx-auto pt-2 mb-8">
22

3-
<h1 class="mb-2 text-center mt-4 text-4xl font-extrabold leading-none tracking-tight text-gray-900 md:text-4xl lg:text-5xl dark:text-white w-full"><span class="underline underline-offset-3 decoration-8 decoration-primary-100 dark:decoration-primary-100">{{'CATALOGS._all_catalogs' | translate}}</span></h1>
3+
<h1 data-cy="cataloguesAllHeader" class="mb-2 text-center mt-4 text-4xl font-extrabold leading-none tracking-tight text-gray-900 md:text-4xl lg:text-5xl dark:text-white w-full"><span class="underline underline-offset-3 decoration-8 decoration-primary-100 dark:decoration-primary-100">{{'CATALOGS._all_catalogs' | translate}}</span></h1>
44
<p class="mb-8 text-lg font-normal text-gray-500 lg:text-xl sm:px-16 xl:px-48 dark:text-secondary-50 text-center">{{'CATALOGS._choose' | translate}}</p>
55

66
<!-- HEADER SEARCH BAR -->
@@ -33,30 +33,30 @@ <h1 class="mb-2 text-center mt-4 text-4xl font-extrabold leading-none tracking-t
3333

3434
@for (cat of catalogs; track cat.id) {
3535

36-
<div (click)="goToCatalogSearch(cat.id)" class="block cursor-pointer rounded-lg bg-cover mb-4 md:mb-0" style="background-image: url(assets/logos/dome-logo-element-colour.png);" >
36+
<div data-cy="cataloguesList" (click)="goToCatalogSearch(cat.id)" class="block cursor-pointer rounded-lg bg-cover mb-4 md:mb-0" style="background-image: url(assets/logos/dome-logo-element-colour.png);" >
3737
<div class="block w-full h-full p-6 bg-opacity-100 bg-secondary-50 rounded-lg dark:bg-secondary-100 bg-secondary-50/90 dark:bg-secondary-100/90 bg-cover">
38-
<h5 [ngClass]="{
38+
<h5 data-cy="cataloguesTitle" [ngClass]="{
3939
'break-all': hasLongWord(cat.name, 20),
4040
'break-words': !hasLongWord(cat.name, 20)
4141
}" class="text-2xl font-bold tracking-tight line-clamp-4 text-primary-100 dark:text-white text-wrap break-words">{{cat.name}}</h5>
42-
<markdown class="line-clamp-[8] text-wrap break-all dark:text-white text-gray-900" [data]="cat.description ? cat.description : 'CATALOGS._no_desc' | translate"></markdown>
42+
<markdown data-cy="cataloguesDescription" class="line-clamp-[8] text-wrap break-all dark:text-white text-gray-900" [data]="cat.description ? cat.description : 'CATALOGS._no_desc' | translate"></markdown>
4343
<!--<a (click)="showFullDesc(cat);$event.stopPropagation();" class="text-xs font-medium inline-flex items-center px-2.5 py-0.5 rounded-md text-secondary-50 bg-primary-100 dark:bg-secondary-50 dark:text-primary-100 mb-2">
4444
<fa-icon [icon]="faEye" class="text-primary-50 mr-2"></fa-icon>
4545
{{'CATALOGS._view_details' | translate}}
4646
</a>-->
4747
<hr class="h-px my-1 bg-primary-100 border-0 dark:bg-primary-100">
48-
<div class="">
48+
<div data-cy="cataloguesCategories" class="">
4949
@for(category of cat.category; track category.id) {
5050
<span [ngClass]="{
5151
'break-all': hasLongWord(category.name, 20),
5252
'break-words': !hasLongWord(category.name, 20)
5353
}" class="inline-block bg-blue-300 text-primary-100 text-xs font-bold me-2 px-2.5 py-0.5 rounded-full w-fit text-wrap break-words">{{category.name}}</span>
5454
} @empty {
55-
<span class="inline-block bg-blue-300 text-primary-100 text-xs font-bold me-2 px-2.5 py-0.5 rounded-full w-fit text-wrap break-words">{{'CATALOGS._no_cat' | translate}}</span>
55+
<span class="inline-block bg-blue-300 text-primary-100 text-xs font-bold me-2 px-2.5 py-0.5 rounded-full w-fit text-wrap break-words">{{'CATALOGS._no_cat' | translate}}</span>
5656
}
5757
</div>
5858
<div class="flex sticky top-[100vh] justify-center align-items-bottom">
59-
<button (click)="showFullDesc(cat);$event.stopPropagation();" type="button" class="flex mt-2 items-center align-items-bottom text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-100 dark:hover:bg-primary-50 dark:focus:ring-primary-100 mr-1">
59+
<button data-cy="cataloguesViewDetails" (click)="showFullDesc(cat);$event.stopPropagation();" type="button" class="flex mt-2 items-center align-items-bottom text-white bg-primary-100 hover:bg-primary-50 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-100 dark:hover:bg-primary-50 dark:focus:ring-primary-100 mr-1">
6060
<svg class="w-[18px] h-[18px] text-white mr-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 14">
6161
<g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
6262
<path d="M10 10a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/>
@@ -104,7 +104,7 @@ <h1 class="mb-2 text-center mt-4 text-4xl font-extrabold leading-none tracking-t
104104
class="fixed inset-0 z-40 flex flex-col lg:flex-row justify-center overflow-y-auto overflow-x-hidden px-4 pt-[80px] lg:pt-0 lg:items-center">
105105

106106
<div class="relative w-full max-w-4xl">
107-
<div class="relative bg-white dark:bg-secondary-100 rounded-lg shadow-lg bg-cover bg-right-bottom overflow-y-auto max-h-[calc(100vh-160px)]"
107+
<div data-cy="cataloguesDetailsContents" class="relative bg-white dark:bg-secondary-100 rounded-lg shadow-lg bg-cover bg-right-bottom overflow-y-auto max-h-[calc(100vh-160px)]"
108108
(click)="$event.stopPropagation();">
109109

110110
<!-- HEADER -->
@@ -131,7 +131,7 @@ <h5 class="md:text-3xl lg:text-4xl font-semibold tracking-tight text-primary-100
131131
<hr class="h-px my-1 bg-primary-100 border-0 dark:bg-primary-100" />
132132

133133
<!-- CATEGORIES -->
134-
<div class="p-4 flex flex-wrap gap-2">
134+
<div data-cy="cataloguesCategoriesList" class="p-4 flex flex-wrap gap-2">
135135
@for(category of showingCat.category; track category.id) {
136136
<span [ngClass]="{
137137
'break-all': hasLongWord(category.name, 20),

src/app/pages/checkout/checkout.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ <h1 class="mb-4 pb-2 mt-4 text-4xl font-extrabold leading-none tracking-tight te
4646
<p class="text-lg capitalize text-heading lg:text-xl dark:text-white">{{ 'SHOPPING_CART._billingAddress' | translate }}</p></div>
4747
@if (billingAddresses.length > 0) {
4848
<button
49+
data-cy="orderAddBill"
4950
(click)="addBill=true;$event.stopPropagation();"
5051
class="flex items-center text-sm font-semibold text-accent dark:text-white transition-colors duration-200 hover:text-accent-hover focus:text-accent-hover focus:outline-0">
5152
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor" class="h-4 w-4 stroke-2 ltr:mr-0.5 rtl:ml-0.5">

src/app/pages/product-orders/sections/order-info/order-info.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ <h6 class="mb-3 text-sm font-bold text-gray-900 dark:text-white">
201201
</g>
202202
</svg>
203203
</button>
204-
<button (click)="toggleDrawer(order);$event.stopPropagation();" type="button"
204+
<button data-cy="orderNotesButton" (click)="toggleDrawer(order);$event.stopPropagation();" type="button"
205205
class="text-white bg-primary-100 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-full text-sm p-2.5 text-center inline-flex items-center me-2">
206206
@if (hasNotes(order)) {
207207
<svg class="w-[18px] h-[18px] text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">
@@ -265,7 +265,7 @@ <h2 class="md:text-3xl lg:text-4xl font-bold text-primary-100 ml-4 dark:text-whi
265265
</button>
266266
</div>
267267
<!-- Modal body -->
268-
<div class="w-full h-full">
268+
<div data-cy="orderDetailsModal" class="w-full h-full">
269269
<div class="p-4 relative overflow-x-auto rounded-lg">
270270
<div class="flex flex-row gap-2 pb-2 text-gray-600">
271271
<p class="w-fit text-base font-bold shrink-0 dark:text-white">
@@ -563,7 +563,7 @@ <h5 id="drawer-notes-label" class="flex items-center text-base font-semibold tex
563563
</div>
564564

565565
<!-- Display notes when available -->
566-
<div *ngFor="let note of selectedOrder?.note" class="flex"
566+
<div data-cy="orderNotesMessages" *ngFor="let note of selectedOrder?.note" class="flex"
567567
[ngClass]="{'justify-end': note.author === partyId, 'justify-start': note.author !== partyId}">
568568

569569
<div class="max-w-xs p-3 rounded-lg shadow-md"
@@ -589,11 +589,11 @@ <h5 id="drawer-notes-label" class="flex items-center text-base font-semibold tex
589589
<!-- Input for adding new notes (fixed at the bottom) -->
590590
<div class="border-t pt-3">
591591
<div class="flex flex-col">
592-
<textarea [(ngModel)]="newNoteText"
592+
<textarea data-cy="orderNotesTextField" [(ngModel)]="newNoteText"
593593
class="w-full p-2 text-sm border rounded-lg resize-none h-20"
594594
placeholder="Write a new note..."
595595
(keyup.enter)="addNote()"></textarea>
596-
<button (click)="addNote()"
596+
<button data-cy="orderNotesSendButton" (click)="addNote()"
597597
class="mt-2 px-4 py-2 text-sm font-semibold text-white bg-blue-500 rounded-lg hover:bg-blue-600">
598598
{{ isUpdating ? 'Saving...' : 'Send' }}
599599
</button>

0 commit comments

Comments
 (0)