Skip to content

Commit

Permalink
[HXCS-1322] fix e2e NotificaionComponent demo (#8413)
Browse files Browse the repository at this point in the history
* [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 <[email protected]>
  • Loading branch information
wideLandscape and Adriano Costa authored Mar 23, 2023
1 parent fb01ab7 commit 1b3275d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { takeUntil } from 'rxjs/operators';
export class NotificationsComponent implements OnInit, OnDestroy {

message = 'I ♥️ ADF';
decorativeIcon = 'folder';
decorativeIcon = '';
withAction = false;
actionOutput = '';
snackBarConfigObject = '';
Expand Down
14 changes: 7 additions & 7 deletions e2e/core/notifications-component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ describe('Notifications Component', () => {
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 () => {
await notificationPage.enterMessageField('test');
await notificationPage.clickActionToggle();
Expand Down Expand Up @@ -103,6 +96,13 @@ describe('Notifications Component', () => {
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 () => {
await notificationPage.enterMessageField('test');
await notificationPage.enterDurationField(1000);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<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>
<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>
<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"
data-automation-id="adf-snackbar-message-content-action-button">
Expand Down

0 comments on commit 1b3275d

Please sign in to comment.