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 @@ -347,23 +347,23 @@ export function crossEnvironmentSpecs(
347
347
} ) ;
348
348
349
349
it ( 'should be able to hover' , async ( ) => {
350
- const host = await harness . host ( ) ;
351
- let classAttr = await host . getAttribute ( 'class' ) ;
350
+ const box = await harness . hoverTest ( ) ;
351
+ let classAttr = await box . getAttribute ( 'class' ) ;
352
352
expect ( classAttr ) . not . toContain ( 'hovering' ) ;
353
- await host . hover ( ) ;
354
- classAttr = await host . getAttribute ( 'class' ) ;
353
+ await box . hover ( ) ;
354
+ classAttr = await box . getAttribute ( 'class' ) ;
355
355
expect ( classAttr ) . toContain ( 'hovering' ) ;
356
356
} ) ;
357
357
358
358
it ( 'should be able to stop hovering' , async ( ) => {
359
- const host = await harness . host ( ) ;
360
- let classAttr = await host . getAttribute ( 'class' ) ;
359
+ const box = await harness . hoverTest ( ) ;
360
+ let classAttr = await box . getAttribute ( 'class' ) ;
361
361
expect ( classAttr ) . not . toContain ( 'hovering' ) ;
362
- await host . hover ( ) ;
363
- classAttr = await host . getAttribute ( 'class' ) ;
362
+ await box . hover ( ) ;
363
+ classAttr = await box . getAttribute ( 'class' ) ;
364
364
expect ( classAttr ) . toContain ( 'hovering' ) ;
365
- await host . mouseAway ( ) ;
366
- classAttr = await host . getAttribute ( 'class' ) ;
365
+ await box . mouseAway ( ) ;
366
+ classAttr = await box . getAttribute ( 'class' ) ;
367
367
expect ( classAttr ) . not . toContain ( 'hovering' ) ;
368
368
} ) ;
369
369
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ export class MainComponentHarness extends ComponentHarness {
84
84
readonly shadows = this . locatorForAll ( '.in-the-shadows' ) ;
85
85
readonly deepShadow = this . locatorFor (
86
86
'test-shadow-boundary test-sub-shadow-boundary > .in-the-shadows' ) ;
87
+ readonly hoverTest = this . locatorFor ( '#hover-box' ) ;
87
88
88
89
private _testTools = this . locatorFor ( SubComponentHarness ) ;
89
90
Original file line number Diff line number Diff line change @@ -33,3 +33,11 @@ <h1 style="height: 100px; width: 200px;">Main Component</h1>
33
33
< span id ="task-state-result " #taskStateResult > </ span >
34
34
</ div >
35
35
< test-shadow-boundary *ngIf ="_shadowDomSupported "> </ test-shadow-boundary >
36
+
37
+
38
+ < div
39
+ id ="hover-box "
40
+ [class.hovering] ="isHovering "
41
+ (mouseenter) ="isHovering = true "
42
+ (mouseleave) ="isHovering = false "
43
+ 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 ;
@@ -50,14 +45,6 @@ export class TestMainComponent implements OnDestroy {
50
45
51
46
private _fakeOverlayElement : HTMLElement ;
52
47
53
- onMouseEnter ( ) {
54
- this . _isHovering = true ;
55
- }
56
-
57
- onMouseLeave ( ) {
58
- this . _isHovering = false ;
59
- }
60
-
61
48
constructor ( private _cdr : ChangeDetectorRef , private _zone : NgZone ) {
62
49
this . username = 'Yi' ;
63
50
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