[HXCS-1322] fix e2e NotificaionComponent demo (#8413)

* [HXCS-1322] fix e2e NotificaionComponent demo

* [HXCS-1173] revert to  one line

* [HXCS-1173] move new test after breaking tests

---------

Co-authored-by: Adriano Costa <Adriano.Costa@hyland.comgit>
This commit is contained in:
Adriano Costa
2023-03-23 21:14:23 +01:00
committed by GitHub
parent fb01ab7619
commit 1b3275d064
3 changed files with 9 additions and 11 deletions

View File

@@ -29,7 +29,7 @@ import { takeUntil } from 'rxjs/operators';
export class NotificationsComponent implements OnInit, OnDestroy { export class NotificationsComponent implements OnInit, OnDestroy {
message = 'I ♥️ ADF'; message = 'I ♥️ ADF';
decorativeIcon = 'folder'; decorativeIcon = '';
withAction = false; withAction = false;
actionOutput = ''; actionOutput = '';
snackBarConfigObject = ''; snackBarConfigObject = '';

View File

@@ -67,13 +67,6 @@ describe('Notifications Component', () => {
await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toEqual('test'); await expect(await notificationPage.snackbarPage.getSnackBarMessage()).toEqual('test');
}); });
it('[C694098] Should show a decorative icon when the message and the icon fields are not empty and button is clicked', async () => {
await notificationPage.enterMessageField('test');
await notificationPage.enterDecorativeIconField('folder');
await notificationPage.clickNotificationButton();
await expect(await notificationPage.snackbarPage.getSnackBarDecorativeIcon()).toEqual('folder');
});
it('[C279978] Should show notification with action when the message is not empty and button is clicked', async () => { it('[C279978] Should show notification with action when the message is not empty and button is clicked', async () => {
await notificationPage.enterMessageField('test'); await notificationPage.enterMessageField('test');
await notificationPage.clickActionToggle(); await notificationPage.clickActionToggle();
@@ -103,6 +96,13 @@ describe('Notifications Component', () => {
await notificationPage.clickActionToggle(); await notificationPage.clickActionToggle();
}); });
it('[C694098] Should show a decorative icon when the message and the icon fields are not empty and button is clicked', async () => {
await notificationPage.enterMessageField('test');
await notificationPage.enterDecorativeIconField('folder');
await notificationPage.clickNotificationButton();
await expect(await notificationPage.snackbarPage.getSnackBarDecorativeIcon()).toEqual('folder');
});
it('[C279987] Should show custom notification during a limited time when a duration is added', async () => { it('[C279987] Should show custom notification during a limited time when a duration is added', async () => {
await notificationPage.enterMessageField('test'); await notificationPage.enterMessageField('test');
await notificationPage.enterDurationField(1000); await notificationPage.enterDurationField(1000);

View File

@@ -1,6 +1,4 @@
<p class="adf-snackbar-message-content" data-automation-id="adf-snackbar-message-content" aria-hidden="true"> <p class="adf-snackbar-message-content" data-automation-id="adf-snackbar-message-content" aria-hidden="true"><mat-icon *ngIf="data.decorativeIcon" data-automation-id="adf-snackbar-decorative-icon">{{ data.decorativeIcon }}</mat-icon>{{ data.message }}</p>
<mat-icon *ngIf="data.decorativeIcon" data-automation-id="adf-snackbar-decorative-icon">{{ data.decorativeIcon }}</mat-icon>{{ data.message }}
</p>
<div *ngIf="data.showAction" class="adf-snackbar-message-content-action" aria-hidden="true"> <div *ngIf="data.showAction" class="adf-snackbar-message-content-action" aria-hidden="true">
<button mat-button (click)="snackBarRef.dismissWithAction()" *ngIf="data.actionLabel" class="adf-snackbar-message-content-action-button" <button mat-button (click)="snackBarRef.dismissWithAction()" *ngIf="data.actionLabel" class="adf-snackbar-message-content-action-button"
data-automation-id="adf-snackbar-message-content-action-button"> data-automation-id="adf-snackbar-message-content-action-button">