forked from onecx/onecx-portal-ui-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: adjusted button-dialog harness to fetch its body more clear
- Loading branch information
Showing
5 changed files
with
41 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ore/components/button-dialog/dialog-message-content/dialog-message-content.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
libs/portal-integration-angular/testing/dialog-message-content.harness.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ComponentHarness } from '@angular/cdk/testing' | ||
|
||
export class DialogMessageContentHarness extends ComponentHarness { | ||
static hostSelector = '.dialogMessageContent' | ||
|
||
private getMessageSpan = this.locatorFor('#dialogMessage') | ||
private getIcon = this.locatorForOptional('i') | ||
|
||
async getMessageContent(): Promise<string> { | ||
return await (await this.getMessageSpan()).text() | ||
} | ||
|
||
async getIconValue(): Promise<string | null | undefined> { | ||
return await (await this.getIcon())?.getAttribute('class') | ||
} | ||
} |