File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,15 @@ public function testFocus()
56
56
57
57
$ focusBlurDetector ->focus ();
58
58
$ this ->assertEquals ('focused ' , $ focusBlurDetector ->getValue ());
59
+
60
+ $ focusableAnchor = $ this ->getAssertSession ()->elementExists ('css ' , '.elements a#focusable ' );
61
+ $ this ->assertEquals ('no action detected ' , $ focusableAnchor ->getText ());
62
+
63
+ $ focusableAnchor ->focus ();
64
+ // checking that we're on same page
65
+ $ this ->getAssertSession ()->addressEquals ('/js_test.html ' );
66
+ $ this ->assertEquals ('focused ' , $ focusableAnchor ->getText ());
67
+
59
68
}
60
69
61
70
/**
@@ -68,6 +77,8 @@ public function testBlur()
68
77
$ focusBlurDetector = $ this ->getAssertSession ()->elementExists ('css ' , '.elements input#focus-blur-detector ' );
69
78
$ this ->assertEquals ('no action detected ' , $ focusBlurDetector ->getValue ());
70
79
80
+ // focusing before, because blur won't be triggered if HTMLElement is not focused
81
+ $ focusBlurDetector ->focus ();
71
82
$ focusBlurDetector ->blur ();
72
83
$ this ->assertEquals ('blured ' , $ focusBlurDetector ->getValue ());
73
84
}
You can’t perform that action at this time.
0 commit comments