File tree Expand file tree Collapse file tree 2 files changed +21
-54
lines changed
core/src/components/alert/test Expand file tree Collapse file tree 2 files changed +21
-54
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,27 @@ const testAria = async (
1717
1818 const alert = page . locator ( 'ion-alert' ) ;
1919
20+ const header = alert . locator ( '.alert-title' ) ;
21+ const subHeader = alert . locator ( '.alert-sub-title' ) ;
22+
23+ // If a header exists, it should be an h2 element
24+ if ( await header . count ( ) > 0 ) {
25+ const headerTagName = await header . evaluate ( ( el ) => el . tagName ) ;
26+ expect ( headerTagName ) . toBe ( 'H2' ) ;
27+ }
28+
29+ // If a header and subHeader exist, the subHeader should be an h3 element
30+ if ( await header . count ( ) > 0 && await subHeader . count ( ) > 0 ) {
31+ const subHeaderTagName = await subHeader . evaluate ( ( el ) => el . tagName ) ;
32+ expect ( subHeaderTagName ) . toBe ( 'H3' ) ;
33+ }
34+
35+ // If a subHeader exists without a header, the subHeader should be an h2 element
36+ if ( await header . count ( ) === 0 && await subHeader . count ( ) > 0 ) {
37+ const subHeaderTagName = await subHeader . evaluate ( ( el ) => el . tagName ) ;
38+ expect ( subHeaderTagName ) . toBe ( 'H2' ) ;
39+ }
40+
2041 /**
2142 * expect().toHaveAttribute() can't check for a null value, so grab and check
2243 * the values manually instead.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments