File tree 6 files changed +27
-30
lines changed
6 files changed +27
-30
lines changed Original file line number Diff line number Diff line change @@ -354,23 +354,23 @@ export function crossEnvironmentSpecs(
354
354
} ) ;
355
355
356
356
it ( 'should be able to hover' , async ( ) => {
357
- const host = await harness . host ( ) ;
358
- let classAttr = await host . getAttribute ( 'class' ) ;
357
+ const box = await harness . hoverTest ( ) ;
358
+ let classAttr = await box . getAttribute ( 'class' ) ;
359
359
expect ( classAttr ) . not . toContain ( 'hovering' ) ;
360
- await host . hover ( ) ;
361
- classAttr = await host . getAttribute ( 'class' ) ;
360
+ await box . hover ( ) ;
361
+ classAttr = await box . getAttribute ( 'class' ) ;
362
362
expect ( classAttr ) . toContain ( 'hovering' ) ;
363
363
} ) ;
364
364
365
365
it ( 'should be able to stop hovering' , async ( ) => {
366
- const host = await harness . host ( ) ;
367
- let classAttr = await host . getAttribute ( 'class' ) ;
366
+ const box = await harness . hoverTest ( ) ;
367
+ let classAttr = await box . getAttribute ( 'class' ) ;
368
368
expect ( classAttr ) . not . toContain ( 'hovering' ) ;
369
- await host . hover ( ) ;
370
- classAttr = await host . getAttribute ( 'class' ) ;
369
+ await box . hover ( ) ;
370
+ classAttr = await box . getAttribute ( 'class' ) ;
371
371
expect ( classAttr ) . toContain ( 'hovering' ) ;
372
- await host . mouseAway ( ) ;
373
- classAttr = await host . getAttribute ( 'class' ) ;
372
+ await box . mouseAway ( ) ;
373
+ classAttr = await box . getAttribute ( 'class' ) ;
374
374
expect ( classAttr ) . not . toContain ( 'hovering' ) ;
375
375
} ) ;
376
376
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ export class MainComponentHarness extends ComponentHarness {
90
90
readonly shadows = this . locatorForAll ( '.in-the-shadows' ) ;
91
91
readonly deepShadow = this . locatorFor (
92
92
'test-shadow-boundary test-sub-shadow-boundary > .in-the-shadows' ) ;
93
+ readonly hoverTest = this . locatorFor ( '#hover-box' ) ;
93
94
94
95
private _testTools = this . locatorFor ( SubComponentHarness ) ;
95
96
Original file line number Diff line number Diff line change @@ -58,3 +58,11 @@ <h1 style="height: 100px; width: 200px;">Main Component</h1>
58
58
< span id ="task-state-result " #taskStateResult > </ span >
59
59
</ div >
60
60
< test-shadow-boundary *ngIf ="_shadowDomSupported "> </ test-shadow-boundary >
61
+
62
+
63
+ < div
64
+ id ="hover-box "
65
+ [class.hovering] ="isHovering "
66
+ (mouseenter) ="isHovering = true "
67
+ (mouseleave) ="isHovering = false "
68
+ style ="width: 50px; height: 50px; background: hotpink; "> </ div >
Original file line number Diff line number Diff line change @@ -22,11 +22,6 @@ import {
22
22
@Component ( {
23
23
selector : 'test-main' ,
24
24
templateUrl : 'test-main-component.html' ,
25
- host : {
26
- '[class.hovering]' : '_isHovering' ,
27
- '(mouseenter)' : 'onMouseEnter()' ,
28
- '(mouseleave)' : 'onMouseLeave()' ,
29
- } ,
30
25
encapsulation : ViewEncapsulation . None ,
31
26
changeDetection : ChangeDetectionStrategy . OnPush ,
32
27
} )
@@ -39,7 +34,7 @@ export class TestMainComponent implements OnDestroy {
39
34
memo : string ;
40
35
testTools : string [ ] ;
41
36
testMethods : string [ ] ;
42
- _isHovering : boolean ;
37
+ isHovering = false ;
43
38
specialKey = '' ;
44
39
relativeX = 0 ;
45
40
relativeY = 0 ;
@@ -54,14 +49,6 @@ export class TestMainComponent implements OnDestroy {
54
49
55
50
private _fakeOverlayElement : HTMLElement ;
56
51
57
- onMouseEnter ( ) {
58
- this . _isHovering = true ;
59
- }
60
-
61
- onMouseLeave ( ) {
62
- this . _isHovering = false ;
63
- }
64
-
65
52
constructor ( private _cdr : ChangeDetectorRef , private _zone : NgZone ) {
66
53
this . username = 'Yi' ;
67
54
this . counter = 0 ;
Original file line number Diff line number Diff line change 7
7
* - `saucelabs`: Launches the browser within Saucelabs
8
8
*/
9
9
const browserConfig = {
10
- 'Edge83' : { unitTest : { target : 'saucelabs ' } } ,
10
+ 'Edge83' : { unitTest : { target : 'browserstack ' } } ,
11
11
'iOS13' : { unitTest : { target : 'saucelabs' } } ,
12
12
'Safari13' : { unitTest : { target : 'browserstack' } } ,
13
13
} ;
Original file line number Diff line number Diff line change 19
19
"platformName" : " iOS" ,
20
20
"deviceName" : " iPhone XS Simulator"
21
21
},
22
- "SAUCELABS_EDGE83" : {
23
- "base" : " SauceLabs" ,
24
- "browserName" : " MicrosoftEdge" ,
25
- "browserVersion" : " 83.0" ,
26
- "platformName" : " Windows 10"
22
+ "BROWSERSTACK_EDGE83" : {
23
+ "base" : " BrowserStack" ,
24
+ "browser" : " Edge" ,
25
+ "browser_version" : " 83.0" ,
26
+ "os" : " Windows" ,
27
+ "os_version" : " 10"
27
28
},
28
29
"BROWSERSTACK_SAFARI13" : {
29
30
"base" : " BrowserStack" ,
You can’t perform that action at this time.
0 commit comments